• 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!

give condition when summon dies

Reyn

On to the next One
Joined
May 15, 2010
Messages
259
Reaction score
1
Location
Germany ;3
hei :p
i need a creaturescript which gives a local condition (poison, ...) when a summon of mine dies which is summoned with
Code:
doSummonMonster(cid, "Demon")
i hope someone could help me out with this ^^
Regards, Reyn
 
I can't complete the whole script but I can give clues for whoever wish to help you out:

Summon script:
local uid = doSummonMonster(cid, "Demon")
registerCreatureEvent(uid, "script name") -- register onDeath script for summon


onDeath script:
local master = getCreatureMaster(cid)
if(isCreature(master)) then
-- set condition to "master"
end
 
yes, by connecting the "registerCreatureEvent" to the summoned creature and the onDeath function, it will be triggered once this creature dies... But those scripts are not 100% complete, someone else has to fix the last part... Just making them work you know :p
 
okai those lines are good for me ^^ i think i can make the script on my own i guess :p
if not i will be requesting it here again xD but i think it will be easy to make it with this line :) thanks to you
 
Okai ive got a problem now :S
i'Ve done this
summon talkaction parts
Lua:
				queststatus = getPlayerStorageValue(cid,1212)
				if queststatus == 1 then
					doSendMagicEffect(getCreaturePosition(cid), effect)
					registerCreatureEvent(uid, "summondeath")
				else
Lua:
local uid = doSummonMonster(cid, "Demon")
at login.lua
Lua:
	registerCreatureEvent(cid, "summondeath")
at creaturescrpits.xml
Code:
	<event type="death" name="summondeath" event="script" value="summondeath.lua"/>
and at summondeath.lua
Lua:
local master = getCreatureMaster(cid)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') + 300000))

function onDeath(cid, corpse, killer)
	if(isCreature(master)) then
		doAddCondition(cid, exhaust)
	end
return TRUE
end
this is the error in console >.<
Code:
[01/09/2010 01:56:17] [Error - TalkAction Interface] 
[01/09/2010 01:56:17] data/talkactions/scripts/SummonPartner.lua:onSay
[01/09/2010 01:56:17] Description: 
[01/09/2010 01:56:17] (luaRegisterCreatureEvent) Creature not found
 
Can you show me the whole code of which you have the line "local uid = doSummonMonster(cid, "Demon")" ?? If you don't want to public it, you can PM it to me...
 
Back
Top