• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Absorb

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:
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"/>
 
Sorry if I'm n00b but i didn't understand how this script work and what it's good for:S
 
it was for a request some1 made, and he did it, what it does is to absorb near corpses (make'em disapear), you can use it as you want, for an spell which requires 'corpse charges', for rewarding your players if they clean the map from corpses... use ur imagination my friend ;)
 
Back
Top Bottom