From 8e2a5876f3a224acf5a94a1c701fbaa3396129e1 Mon Sep 17 00:00:00 2001 From: Jusctsch5 Date: Sun, 22 Feb 2015 12:05:37 -0600 Subject: [PATCH] T2RPG: Add "Flow" spell for Neutral Magic Requires 50 Neutral Magic. Casts for 15 mana, increases your speed by a multiplier based on the caster's neutral magic for 60 seconds --- scripts/rpgskills.cs | 3 +-- scripts/rpgspells.cs | 62 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/scripts/rpgskills.cs b/scripts/rpgskills.cs index 9513bae..bfcf4a5 100644 --- a/scripts/rpgskills.cs +++ b/scripts/rpgskills.cs @@ -677,9 +677,8 @@ $SkillRestriction[Guildteleport] = $Skill::NeutralCasting @ " 20"; $SkillRestriction[AdvGuildteleport] = $Skill::NeutralCasting @ " 260"; $SkillRestriction[transport] = $Skill::NeutralCasting @ " 200"; $SkillRestriction[advtransport] = $Skill::NeutralCasting @ " 350"; -//$SkillRestriction[remort] = $Skill::NeutralCasting @ " 0 " @ $MinLevel @ " 101"; -//$SkillRestriction[mimic] = $Skill::NeutralCasting @ " 145 " @ $MinRemort @ " 2"; $SkillRestriction[masstransport] = $Skill::NeutralCasting @ " 650"; +$SkillRestriction[flow] = $Skill::NeutralCasting @ " 50"; $SkillRestriction[heal] = $Skill::DefensiveCasting @ " 10"; $SkillRestriction[strongheal] = $Skill::DefensiveCasting @ " 80"; diff --git a/scripts/rpgspells.cs b/scripts/rpgspells.cs index e559ec3..25e1c74 100644 --- a/scripts/rpgspells.cs +++ b/scripts/rpgspells.cs @@ -539,6 +539,20 @@ $spelldata[AdvGuildTeleport, Cost] = 10; $spelldata[AdvGuildTeleport, Function] = "DoSpellGuildTeleportLOS"; $spelldata[AdvGuildTeleport, Skill] = $Skill::NeutralCasting; +$spelldata[Flow, Image] = HealAuraEmitter2; +$spelldata[Flow, DamageMod] = ""; +$spelldata[Flow, NumEffect] = "10"; +$spelldata[Flow, Test] = 1; +$spelldata[Flow, Delay] = 1500; +$spelldata[Flow, Element] = "Generic"; +$spelldata[Flow, RecoveryTime] = 4000; +$spelldata[Flow, Type] = Emitter; +$spelldata[Flow, cost] = 15; // should be 15 +$spelldata[Flow, Duration] = 60000; +$spelldata[Flow, Special] = "Flow"; +$spelldata[Flow, Function] = "DoFlowSpellCast"; +$spelldata[Flow, 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; @@ -1546,3 +1560,51 @@ function DoSpellGuildTeleportLOS(%client, %spell, %sdata, %params) } } + +function DoFlowSpellCast(%client, %spell, %sdata, %params) +{ + // Make sure an existing flow isn't active. + if (%client.flowActive == true) + { + return; + } + + %client.flowActive = 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.flowIncrease = $spelldata[%sdata, numEffect] + (%client.data.PlayerSkill[$skill::NeutralCasting] / 10); + echo("Casting Flow, increasing speed by" SPC %client.flowIncrease); + %increase = %client.flowIncrease; + %client.player.getDataBlock().maxForwardSpeed += %increase; + %client.player.getDataBlock().maxBackwardSpeed += %increase; + %client.player.getDataBlock().maxSideSpeed += %increase; + %client.player.getDataBlock().maxUnderwaterForwardSpeed += %increase; + %client.player.getDataBlock().maxUnderwaterBackwardSpeed += %increase; + %client.player.getDataBlock().maxUnderwaterSideSpeed += %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, "EndFlow", %client); +} +function EndFlow(%client) +{ + echo("Flow ending, decreasing speed by" SPC %client.flowIncrease); + + %decrease = 0 - %client.flowIncrease; + %client.player.getDataBlock().maxForwardSpeed += %decrease; + %client.player.getDataBlock().maxBackwardSpeed += %decrease; + %client.player.getDataBlock().maxSideSpeed += %decrease; + %client.player.getDataBlock().maxUnderwaterForwardSpeed += %decrease; + %client.player.getDataBlock().maxUnderwaterBackwardSpeed += %decrease; + %client.player.getDataBlock().maxUnderwaterSideSpeed += %decrease; + + %client.flowActive = false; +} \ No newline at end of file