Majster12
Member
- Joined
- Feb 20, 2009
- Messages
- 134
- Solutions
- 1
- Reaction score
- 16
Hello!
It's my transform script.
I need little help with storages.
I need to save maxmana and maxhp in storages because when player use transform and die or logout he can transform again and again. Every time script give him mana and hp.
Can somebody edit it for me?
Thanks in advance
It's my transform script.
I need little help with storages.
I need to save maxmana and maxhp in storages because when player use transform and die or logout he can transform again and again. Every time script give him mana and hp.
Can somebody edit it for me?
Thanks in advance
Code:
function onSay(cid, words, param)
local postac1 = { -- goku
[1] = {1,2,3,4,5,6}, -- Vocation
[2] = {2,56,62,83,8,59}, -- Outfit
[3] = {0,30,50,100,150,200}, -- Level NEED
[4] = {3,3,3,3,3,3}, -- Effect ID
[5] = {1000, 2000, 3000, 4000, 5000, 6000}, -- Additional HP
[6] = {1000, 2000, 3000, 4000, 5000, 6000} -- Additional Mana
}
local postac2 = { --vegeta
[1] = {7,8,9,10,11,12}, -- Vocation
[2] = {70,138,125,284,296,300}, -- Outfit
[3] = {0,30,50,100,150,200}, -- Level NEED
[4] = {3,3,3,3,3,3}, -- Effect ID
[5] = {1000, 2000, 3000, 4000, 5000, 6000}, -- Additional HP
[6] = {1000, 2000, 3000, 4000, 5000, 6000} -- Additional Mana
}
transform(cid, postac1)
transform(cid, postac2)
return true
end
function transform(cid, parameter)
for i = 1, #parameter[1] do
if i >= #parameter[1] then
elseif getPlayerLevel(cid) < parameter[3][i+1] and getPlayerVocation(cid) == parameter[1][i] then
doPlayerSendCancel(cid, "Required level is ".. parameter[3][i+1] .." to transform!")
elseif getPlayerLevel(cid) >= parameter[3][#parameter[3]] and getPlayerVocation(cid) == parameter[1][#parameter[1]] then
doPlayerSendCancel(cid, "Its u last Transform!")
elseif getPlayerVocation(cid) == parameter[1][i] and getPlayerLevel(cid) >= parameter[3][i+1] then
doPlayerSetVocation(cid, parameter[1][i+1])
local outfit = {lookType = parameter[2][i+1] , lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
doSetCreatureOutfit(cid, outfit, -1)
doSendMagicEffect(getCreaturePosition(cid), parameter[4][i+1])
doPlayerSendCancel(cid, "Transform Success.")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+parameter[5][i+1])
setCreatureMaxMana(cid, getCreatureMaxMana(cid)+parameter[6][i+1])
return true
end
end
end