From 440ac4a61c5b3edea9e5e41220d0975b7942a225 Mon Sep 17 00:00:00 2001 From: Jusctsch5 Date: Mon, 23 Mar 2015 19:57:41 -0500 Subject: [PATCH] T2RPG: Fix Flow and Bound Spells Balances Flow and Bound to not scale with Neutral Magic level. Fixes a bug where flow and bound would subtract from your base character's jumping and speed attributes when cast prior to death. Fixes some general formatting things in the related files. --- scripts/RPGGame.cs | 2 +- scripts/rpgplayer.cs | 18 +++-- scripts/rpgspells.cs | 158 +++++++++++++++++++++---------------------- 3 files changed, 92 insertions(+), 86 deletions(-) diff --git a/scripts/RPGGame.cs b/scripts/RPGGame.cs index 52f361c..e84768e 100644 --- a/scripts/RPGGame.cs +++ b/scripts/RPGGame.cs @@ -507,7 +507,7 @@ function RPGGame::createPlayer(%game, %client, %spawnLoc, %respawn) { case "MaleOrcArmor": echo("valid"); case "MaleHumanArmor":echo("valid"); - default:echo("INVALID ARMOR! using server default"); + default:echo("INVALID ARMOR - " SPC %armor SPC " - using server default."); %armor = "MaleHumanArmor"; } %client.armor = %armor; diff --git a/scripts/rpgplayer.cs b/scripts/rpgplayer.cs index 7c823e6..64832c1 100644 --- a/scripts/rpgplayer.cs +++ b/scripts/rpgplayer.cs @@ -4,6 +4,8 @@ exec("shapes/base_male.cs"); exec("shapes/mino.cs"); //exec("shapes/fish.cs"); damn fish. //rpg's default armor for now + + datablock PlayerData(MaleHumanArmor) : LightPlayerDamageProfile { emap = true; @@ -72,13 +74,13 @@ datablock PlayerData(MaleHumanArmor) : LightPlayerDamageProfile runForce = 48 * 120 *2; runEnergyDrain = 0.005; minRunEnergy = 0.0; - maxForwardSpeed = 20; - maxBackwardSpeed = 18; - maxSideSpeed = 18; + maxForwardSpeed = 10; + maxBackwardSpeed = 9; + maxSideSpeed = 9; - maxUnderwaterForwardSpeed = 15; - maxUnderwaterBackwardSpeed = 12; - maxUnderwaterSideSpeed = 12; + maxUnderwaterForwardSpeed = 6; + maxUnderwaterBackwardSpeed = 5.4; + maxUnderwaterSideSpeed = 5.4; jumpForce = 6 * 90; jumpEnergyDrain = 0; @@ -193,6 +195,7 @@ datablock PlayerData(MaleHumanArmor) : LightPlayerDamageProfile exitingWater = ExitingWaterLightSound; observeParameters = "0.5 4.5 4.5"; + }; datablock PlayerData(DeathKnightArmor) : HeavyMaleHumanArmor @@ -695,6 +698,9 @@ datablock PlayerData(MonsterArmor) : MaleHumanArmor maxUnderwaterSideSpeed = 50.4; runSurfaceAngle = 85; jumpSurfaceAngle = 80; + + flowActive = false; + boundActive = false; }; datablock PlayerData(GnollArmor) : MonsterArmor { diff --git a/scripts/rpgspells.cs b/scripts/rpgspells.cs index cd20ef1..59db747 100644 --- a/scripts/rpgspells.cs +++ b/scripts/rpgspells.cs @@ -541,13 +541,13 @@ $spelldata[AdvGuildTeleport, Skill] = $Skill::NeutralCasting; $spelldata[Flow, Image] = HealAuraEmitter2; $spelldata[Flow, DamageMod] = ""; -$spelldata[Flow, NumEffect] = "10"; +$spelldata[Flow, NumEffect] = "5"; $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, cost] = 10; // 10 $spelldata[Flow, Duration] = 60000; $spelldata[Flow, Special] = "Flow"; $spelldata[Flow, Function] = "DoFlowSpellCast"; @@ -556,13 +556,13 @@ $spelldata[Flow, Skill] = $Skill::NeutralCasting; // Spelldata for Bound spell. $spelldata[Bound, Image] = HealAuraEmitter2; $spelldata[Bound, DamageMod] = ""; -$spelldata[Bound, NumEffect] = "1000"; +$spelldata[Bound, NumEffect] = "1300"; $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, cost] = 15; // 15 $spelldata[Bound, Duration] = 60000; $spelldata[Bound, Special] = "Bound"; $spelldata[Bound, Function] = "DoBoundSpellCast"; @@ -1578,92 +1578,92 @@ function DoSpellGuildTeleportLOS(%client, %spell, %sdata, %params) function DoFlowSpellCast(%client, %spell, %sdata, %params) { - // Make sure an existing flow isn't active. - if (%client.flowActive == true) - { - restoreMANA($spelldata[%sdata, Cost]); + // Make sure an existing flow isn't active. + if (%client.player.getDataBlock().flowActive == true) + { + restoreMANA(%client, $spelldata[%sdata, Cost]); 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] / 20); - 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; - %client.player.getDataBlock().minImpactSpeed += %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); + } + + %client.player.getDataBlock().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. + %client.flowIncrease = $spelldata[%sdata, numEffect]; + echo("Casting Flow, increasing speed by" SPC %client.flowIncrease SPC " from " SPC %client.player.getDataBlock().maxForwardSpeed); + %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; + %client.player.getDataBlock().minImpactSpeed += %increase; + + // 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.player.getDataBlock().minImpactSpeed += %decrease; - %client.flowActive = false; + if (%client.player.getDataBlock().flowActive == true) + { + echo("Flow ending, decreasing speed by" SPC %client.flowIncrease SPC " from " SPC %client.player.getDataBlock().maxForwardSpeed); + + %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.player.getDataBlock().minImpactSpeed += %decrease; + %client.player.getDataBlock().flowActive = false; + } } // For casting Bound function DoBoundSpellCast(%client, %spell, %sdata, %params) { - // Make sure an existing Bound isn't active. - if (%client.BoundActive == true) - { - restoreMANA($spelldata[%sdata, Cost]); - 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); + // Make sure an existing Bound isn't active. + if (%client.player.getDataBlock().BoundActive == true) + { + restoreMANA(%client, $spelldata[%sdata, Cost]); + return; + } + + %client.player.getDataBlock().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 stat. + %client.BoundIncrease = $spelldata[%sdata, numEffect]; + echo("Casting Bound, increasing jumping proficency by" SPC %client.BoundIncrease); + %increase = %client.BoundIncrease; + %client.player.getDataBlock().jumpForce += %increase; + %client.player.getDataBlock().minImpactSpeed += %increase; + + // 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); + if (%client.player.getDataBlock().BoundActive == true) + { + echo("Bound ending, decreasing jumping proficency by" SPC %client.BoundIncrease SPC " from " SPC %client.player.getDataBlock().jumpForce); - %decrease = 0 - %client.BoundIncrease; - %client.player.getDataBlock().jumpForce += %decrease; - - - %client.BoundActive = false; + %decrease = 0 - %client.BoundIncrease; + %client.player.getDataBlock().jumpForce += %decrease; + %client.player.getDataBlock().minImpactSpeed += %decrease; + %client.player.getDataBlock().BoundActive = false; + } } \ No newline at end of file