T2RPG: Introduce Bound Spell.

Bound allows the caster to jump higher for a duration. It scales based on
the caster's neutral magic. It uses the same algorithm as the Flow spell..
This commit is contained in:
Jusctsch5 2015-03-07 15:36:33 -06:00
parent 8e2a5876f3
commit da1ba61b19
2 changed files with 57 additions and 0 deletions

View file

@ -679,6 +679,7 @@ $SkillRestriction[transport] = $Skill::NeutralCasting @ " 200";
$SkillRestriction[advtransport] = $Skill::NeutralCasting @ " 350";
$SkillRestriction[masstransport] = $Skill::NeutralCasting @ " 650";
$SkillRestriction[flow] = $Skill::NeutralCasting @ " 50";
$SkillRestriction[bound] = $Skill::NeutralCasting @ " 100";
$SkillRestriction[heal] = $Skill::DefensiveCasting @ " 10";
$SkillRestriction[strongheal] = $Skill::DefensiveCasting @ " 80";

View file

@ -553,6 +553,21 @@ $spelldata[Flow, Special] = "Flow";
$spelldata[Flow, Function] = "DoFlowSpellCast";
$spelldata[Flow, Skill] = $Skill::NeutralCasting;
// Spelldata for Bound spell.
$spelldata[Bound, Image] = HealAuraEmitter2;
$spelldata[Bound, DamageMod] = "";
$spelldata[Bound, NumEffect] = "1000";
$spelldata[Bound, Test] = 1;
$spelldata[Bound, Delay] = 1500;
$spelldata[Bound, Element] = "Generic";
$spelldata[Bound, RecoveryTime] = 4000;
$spelldata[Bound, Type] = Emitter;
$spelldata[Bound, cost] = 20; // 20
$spelldata[Bound, Duration] = 60000;
$spelldata[Bound, Special] = "Bound";
$spelldata[Bound, Function] = "DoBoundSpellCast";
$spelldata[Bound, Skill] = $Skill::NeutralCasting;
//Element to stat bonus declaration:
$Spell::ElementResistance[Fire] = 13;//Fire Resistance format x where x is a number.
$Spell::ElementResistance[Water] = 14;
@ -1607,4 +1622,45 @@ function EndFlow(%client)
%client.player.getDataBlock().maxUnderwaterSideSpeed += %decrease;
%client.flowActive = false;
}
// For casting Bound
function DoBoundSpellCast(%client, %spell, %sdata, %params)
{
// Make sure an existing Bound isn't active.
if (%client.BoundActive == true)
{
return;
}
%client.BoundActive = true;
// Create the 'cast spell' image on the player
%pos = %client.player.getPosition();
%em = createEmitter(%pos, $spelldata[%sdata, Image], "0 0 0");
schedule(1000, 0, "removeExpo", %em);
// Calculate the increase in speed based on the NeutralCasting proficency of the caster.
%client.BoundIncrease = $spelldata[%sdata, numEffect] + (%client.data.PlayerSkill[$skill::NeutralCasting] * 2);
echo("Casting Bound, increasing jumping proficency by" SPC %client.BoundIncrease);
%increase = %client.BoundIncrease;
%client.player.getDataBlock().jumpForce += %increase;
// Update that skill had been successfully cast
UseSkill(%client, $skill::NeutralCasting, true, true, 1, false);
// Set end of skill to terminate bonuses, want to close it slightly before.
%duration = $spelldata[%sdata, duration] - (1 * 1000);
schedule(%duration, %client, "EndBound", %client);
}
function EndBound(%client)
{
echo("Bound ending, decreasing speed by" SPC %client.BoundIncrease);
%decrease = 0 - %client.BoundIncrease;
%client.player.getDataBlock().jumpForce += %decrease;
%client.BoundActive = false;
}