KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
I do it one script for one guy on Request forum.
1) An spell or talkaction called absorb (absorbing corpses of monsters):
- Only vocation 1 and 2 can use it (please make it configurable [i can add/remove vocations who can absorb]
- You have 30 absorbs and you get storage 3405 after this you can absorb 50 and get 3406 storage , after 70 get 3407 etc.
- If you write "absorb" you absorbing corpses in north of player (1 sqm up than player stand)
- It takes 150 mana
Script:
Talkactions.xml
1) An spell or talkaction called absorb (absorbing corpses of monsters):
- Only vocation 1 and 2 can use it (please make it configurable [i can add/remove vocations who can absorb]
- You have 30 absorbs and you get storage 3405 after this you can absorb 50 and get 3406 storage , after 70 get 3407 etc.
- If you write "absorb" you absorbing corpses in north of player (1 sqm up than player stand)
- It takes 150 mana
Script:
Lua:
function onSay(cid,words,param,channel)
local si = {
[3506] = {30, 29, 31, 3600}, -- first stage
[3507] = {70, 69, 71, 3601} -- secon stage
}
local s = si[i]
local absorbsto = 3506
if isInArray({1,2}, getPlayerVocation(cid)) then
if getItemInfo(getThingFromPos(getPlayerLookPos(cid)).itemid).corpseType then
for i = 3506, 3507 do
if getPlayerStorageValue(cid, i) >= 0 then
if getPlayerStorageValue(cid, i) == s[3] then
doPlayerSendCancel(cid, "You have arrived to ".. s[1] ..", you cant execute more absorbs.")
elseif getPlayerStorageValue(cid,i) == s[1] then
setPlayerStorageValue(cid, s[4], 1)
setPlayerStorageValue(cid, s, getPlayerStorageValue(cid,s)+1)
elseif getPlayerStorageValue(cid,i) <= s[2] then
doPlayerSendTextMessage(cid,22,"You absorbed all corpses you can go to NPC Harold")
doRemoveItem(getPlayerLookPos(cid).uid, 1)
doPlayerSendTextMessage(cid,22,"You absorbed ".. getPlayerStorageValue(cid, s) .." of ".. s[1] .." corpses")
setPlayerStorageValue(cid, s, getPlayerStorageValue(cid,s)+1)
doCreatureAddMana(cid, 150)
doSendMagicEffect(getPlayerLookPos(cid), 12)
end
end
end
else
doPlayerSendCancel(cid, "This item there isnt a corpse.")
end
else
doPlayerSendCancel(cid, "You dont have the required vocation.")
end
return 0
end
Talkactions.xml
XML:
<talkaction words="/absorb" event="script" value="name.lua"/>