From e3bd79c370b6e283f0fa8799cc4b1c5cfed8249b Mon Sep 17 00:00:00 2001 From: artem1919 Date: Sun, 19 Jul 2015 03:13:46 +0300 Subject: [PATCH 1/3] Added "setGold" for Gangplank's Q --- gamed/src/LuaChampion.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gamed/src/LuaChampion.cpp b/gamed/src/LuaChampion.cpp index cb314cb3..34811726 100644 --- a/gamed/src/LuaChampion.cpp +++ b/gamed/src/LuaChampion.cpp @@ -50,6 +50,7 @@ void LuaScript::addChampion() { "getBaseAttackSpeed", &Stats::getBaseAttackSpeed, "getAttackSpeedMultiplier", &Stats::getAttackSpeedMultiplier, "getGold", &Stats::getGold, + "setGold", &Stats::setGold, "getGoldPerSecond", &Stats::getGoldPerSecond, "getLevel", &Stats::getLevel, "setCritChance", &Stats::setCritChance, From 989da7da8a78061b8a185f2e1a3c3ed686c3c2e7 Mon Sep 17 00:00:00 2001 From: artem1919 Date: Sun, 19 Jul 2015 03:14:20 +0300 Subject: [PATCH 2/3] Created his W --- lua/champions/Gangplank/W.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lua/champions/Gangplank/W.lua diff --git a/lua/champions/Gangplank/W.lua b/lua/champions/Gangplank/W.lua new file mode 100644 index 00000000..030d487f --- /dev/null +++ b/lua/champions/Gangplank/W.lua @@ -0,0 +1,15 @@ +function finishCasting() + local owner = getOwner() + local newHealth = owner:getStats():getCurrentHealth() + 10 + 70*getSpellLevel() + 1*owner:getStats():getTotalAp() + local maxHealth = owner:getStats():getMaxHealth() + + + if newHealth >= maxHealth then + owner:getStats():setCurrentHealth(maxHealth) + else + owner:getStats():setCurrentHealth(newHealth) + end +end + +function applyEffects() +end From 8bf573550220de31d4ec893c4417e618fb0c29cb Mon Sep 17 00:00:00 2001 From: artem1919 Date: Sun, 19 Jul 2015 03:15:12 +0300 Subject: [PATCH 3/3] Now gives extra gold and limited to 625 range --- lua/champions/Gangplank/Q.lua | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lua/champions/Gangplank/Q.lua b/lua/champions/Gangplank/Q.lua index 18ff4c97..7eed7ed4 100644 --- a/lua/champions/Gangplank/Q.lua +++ b/lua/champions/Gangplank/Q.lua @@ -1,19 +1,31 @@ Vector2 = require 'Vector2' -- include 2d vector lib function finishCasting() - local castTarget = getCastTarget() - addProjectileTargetCustom( "pirate_parley_tar.troy", 0, castTarget ) + local castTarget = getCastTarget() + local current = Vector2:new(getOwnerX(), getOwnerY()) + if current:distance(Vector2:new(castTarget:getX(), castTarget:getY())) <= 625 then + addProjectileTargetCustom("pirate_parley_tar.troy", 0, castTarget) + else + print("Target is too far away") + end + end function applyEffects() - local castTarget = getCastTarget() + local castTarget = getCastTarget() - if ( ( not ( castTarget == 0 ) ) and ( not isDead( castTarget ) ) ) then - local owner = getOwner(); - local damage = getEffectValue(0) + owner:getStats():getTotalAd() - - owner:dealDamageTo( castTarget, damage, DAMAGE_TYPE_PHYSICAL, DAMAGE_SOURCE_SPELL ); - end + if ((not (castTarget == 0)) and (not isDead(castTarget))) then + local owner = getOwner() + local damage = getEffectValue(0) + owner:getStats():getTotalAd() + local newGold = owner:getStats():getGold() + 3 + 1*getSpellLevel() + + if castTarget:getStats():getCurrentHealth() >= damage then + owner:dealDamageTo(castTarget, damage, DAMAGE_TYPE_PHYSICAL, DAMAGE_SOURCE_SPELL) + else + owner:getStats():setGold(newGold) + owner:dealDamageTo(CastTarget, damage, DAMAGE_TYPE_PHYSICAL, DAMAGE_SOURCE_SPELL) + end + end destroyProjectile() end