function onPrepareDeath(cid, deathList)
doCreatureSetDropLoot(cid, false)
return true
end
local t = {
SKULL_WHITE,
SKULL_RED,
SKULL_BLACK
}
function onPrepareDeath(cid, deathList)
if isInArray(t, getCreatureSkullType(cid)) then
doCreatureSetDropLoot(cid, false)
end
return true
end
This first one will prevent anyone from dropping loot.
LUA:function onPrepareDeath(cid, deathList) doCreatureSetDropLoot(cid, false) return true end
This second one will prevent loot from dropping if you have any of those skulls.
LUA:local t = { SKULL_WHITE, SKULL_RED, SKULL_BLACK } function onPrepareDeath(cid, deathList) if isInArray(t, getCreatureSkullType(cid)) then doCreatureSetDropLoot(cid, false) end return true end
J.Dre
registerCreatureEvent(cid, "NoDrop")
<event type="preparedeath" name="NoDrop" event="script" value="no_drop.lua"/>
This first one will prevent anyone from dropping loot.
LUA:function onPrepareDeath(cid, deathList) doCreatureSetDropLoot(cid, false) return true end
This second one will prevent loot from dropping if you have any of those skulls.
LUA:local t = { SKULL_WHITE, SKULL_RED, SKULL_BLACK } function onPrepareDeath(cid, deathList) if isInArray(t, getCreatureSkullType(cid)) then doCreatureSetDropLoot(cid, false) end return true end
J.Dre
function onPrepareDeath(cid, deathList)
doCreatureSetDropLoot(cid, false)
return true
end
local t = {
SKULL_WHITE,
SKULL_RED,
SKULL_BLACK
}
function onPrepareDeath(cid, deathList)
if isInArray(t, getCreatureSkullType(cid)) then
doCreatureSetDropLoot(cid, false)
end
return true
end
<event type="preparedeath" name="AllNoDrop" event="script" value="allnodrop.lua"/>
<event type="preparedeath" name="SkullNoDrop" event="script" value="skullnodrop.lua"/>
First:
data/creaturescripts/scripts/allnodrop.lua
LUA:function onPrepareDeath(cid, deathList) doCreatureSetDropLoot(cid, false) return true end
Second:
data/creaturescripts/scripts/skullnodrop.lua
LUA:local t = { SKULL_WHITE, SKULL_RED, SKULL_BLACK } function onPrepareDeath(cid, deathList) if isInArray(t, getCreatureSkullType(cid)) then doCreatureSetDropLoot(cid, false) end return true end
data/creaturescripts/creaturescripts.xml
XML:<event type="preparedeath" name="AllNoDrop" event="script" value="allnodrop.lua"/> <event type="preparedeath" name="SkullNoDrop" event="script" value="skullnodrop.lua"/>
I think it should be right ;p
ah thanks, but something i need add to login.lua?
registerCreatureEvent(cid,'AllNoDrop')
registerCreatureEvent(cid,'SkullNoDrop')
that doesnt work, all of this!I think so, use
LUA:registerCreatureEvent(cid,'AllNoDrop') registerCreatureEvent(cid,'SkullNoDrop')
local corpse_ids = {
[0] = 3065, -- female
[1] = 3058 -- male
}
function onPrepareDeath(cid, deathList)
doCreatureSetDropLoot(cid, false)
doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
end
return true
end
<event type="preparedeath" name="onPrepareDeath" event="script" value="prevent drop.lua"/>
in the creaturescript.xml addLUA:local corpse_ids = { [0] = 3065, -- female [1] = 3058 -- male } function onPrepareDeath(cid, deathList) doCreatureSetDropLoot(cid, false) doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA) local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), "" for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i]) end return true end
XML:<event type="preparedeath" name="onPrepareDeath" event="script" value="prevent drop.lua"/>
There ya go! Rep++ me if i helped xD