Sebastian Ching
Member
Greetings, im trying add blessings to my avesta, and dont look any working system,, please i need it cuz my players are losing around 7 levels in level 200 +.
Thanks and blessings
Thanks and blessings
function onSay(cid, words, param)
local price = 50000
local n = isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and 7 or 10
if getPlayerLossPercent(cid, 0) >= n then
if doPlayerRemoveMoney(cid, price) == TRUE then
for i=0,2 do
doPlayerSetLossPercent(cid, i, getPlayerLossPercent(cid, i) - 5)
end
doPlayerSendTextMessage(cid, 22, "You have been blessed.")
doSendMagicEffect(getThingPos(cid), 12)
else
doPlayerSendTextMessage(cid, 22, "Sorry, you don't have enough gold.")
end
else
doPlayerSendTextMessage(cid, 22, "You have already been blessed.")
end
return FALSE
end
<talkaction words="!blessing" filter="first words" script="blessing.lua"/>
function onLogin(cid)
if isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and getPlayerLossPercent(cid, 0) > 7 then
for i=0,2 do
doPlayerSetLossPercent(cid, i, 7)
end
end
registerCreatureEvent(cid, "blessings")
return TRUE
end
function onDie(cid, corpse)
local n = isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and 7 or 10
if getPlayerLossPercent(cid, 0) < n then
for i=0,2 do
doPlayerSetLossPercent(cid, i, n)
end
end
return TRUE
end
<event name="blessings" type="login" script="blessings.lua"/>
<event name="blessings" type="die" script="blessings.lua"/>
You have to create groups for both players and gamemaster, then alter flags of the gamemaster group. perhaps this would be fine: 272730398714how did you add gamemaster and characters to the avesta database?