Lopaskurwa
Active Member
- Joined
- Oct 6, 2017
- Messages
- 876
- Solutions
- 2
- Reaction score
- 49
Hi
i have problem with transform effect position, it look like this
And should look like this
Transform.lua
I'm pretty sure that i have to edit getPosition, but i'm thinking, what if i in future will want to make transform effect that takes 32x32 so it will be fucked up again because now my effect take x128 i think. So what you think guys?
i have problem with transform effect position, it look like this
And should look like this
Transform.lua
Code:
function onSay(player, words, param)
local pid = player:getId()
local TRANS = transform[player:getVocation():getId()]
if not TRANS then
player:sendCancelMessage("You cannot transform.")
return false
end
if player:getLevel() < TRANS.level then
player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.")
return false
end
if player:getSoul() < TRANS.rage then
player:sendCancelMessage("You need "..TRANS.rage.." to transform.")
return false
end
if player:getMana() < TRANS.mana then
player:sendCancelMessage("You need "..TRANS.mana.." to transform.")
return false
end
local outfit = player:getOutfit()
outfit.lookType = TRANS.looktype
if TRANS.constant then
player:setOutfit(outfit)
else
player:setOutfit(outfit, false)
end
player:addSoul(-TRANS.rage)
player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
player:setMaxMana(player:getMaxMana() + TRANS.addMana)
player:getPosition():sendMagicEffect(TRANS.effect)
player:setVocation(TRANS.newVoc)
player:save()
return false
end