Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gamed/src/LuaChampion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 21 additions & 9 deletions lua/champions/Gangplank/Q.lua
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions lua/champions/Gangplank/W.lua
Original file line number Diff line number Diff line change
@@ -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