Extrodus
|| Blazera.net ||
So I've created a talk action that enables a certain amount of protection through player loss (sort of like blessings) except just a little more basic for now.
As of right now, items, skills and containers still drop. Even though the PlayerLoss is set and saved.. so I have no idea what is causing this. I have looked through player.cpp and the parts where the item loss does get defined, it seems a bit iffy. Any help is appreciated.
onLogin Creature Script:
TalkAction Code for First Blessing that uses the same method:
Sources: https://github.com/TwistedScorpio/OTHire/tree/fe351b2cbfdc1bfe1148822bf83eebf7ca01791d
If anyone can help find and solve the problem as I have not been able to find it over the past week of trying different methods, thanks for any help in advance!
Regards,
Extrodus
As of right now, items, skills and containers still drop. Even though the PlayerLoss is set and saved.. so I have no idea what is causing this. I have looked through player.cpp and the parts where the item loss does get defined, it seems a bit iffy. Any help is appreciated.
onLogin Creature Script:
Code:
if isPlayer(cid) and getPlayerLevel(cid) < 30 then
print("Low Level Loss Protection")
setPlayerStorageValue(cid, 13337, 4)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILL, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
doPlayerSendTextMessage(cid, 18, "Protection: Your Experience and Item Loss is reduced to 0% while you are under level 30!")
doSavePlayer(cid)
end
TalkAction Code for First Blessing that uses the same method:
Code:
function onSay(cid, words, param)
if getPlayerStorageValue(cid, 13337) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You already have the first blessing!")
elseif getPlayerStorageValue(cid, 13337) == 2 or getPlayerStorageValue(cid, 13337) == 3 or getPlayerStorageValue(cid, 13337) == 4 or getPlayerStorageValue(cid, 13337) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You already have a stronger blessing!")
elseif doPlayerRemoveMoney(cid, 7500) then
setPlayerStorageValue(cid, 13337, 1)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 70)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 70)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILL, 70)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 7)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 70)
doSavePlayer(cid)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have successfully purchased the first blessing for 70% Loss Percent.")
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You dont have enough gold coins {7,500gp} to purchase this!")
end
return false
end
Sources: https://github.com/TwistedScorpio/OTHire/tree/fe351b2cbfdc1bfe1148822bf83eebf7ca01791d
If anyone can help find and solve the problem as I have not been able to find it over the past week of trying different methods, thanks for any help in advance!
Regards,
Extrodus
Last edited by a moderator: