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

Global item drop for TFS 0.4

skywalker16

New Member
Joined
Nov 5, 2008
Messages
250
Reaction score
1
Location
Switzerland
I'd like to have a item dropped by all monsters by XX percent and maybe be able to change the item depending on the monsters exp.

The system was used in RL Tibia on their 10th birthday I think. All monsters lower than XX exp dropped blue surprise bags by XX chance and all over XX exp dropped the red surprise bags.

Anyone could fix a script for that :) - thanks a lot!
 
Its sounds like a great idea, but could be bugged if its not correctly done for a server using stages, and getting the original exp from the xml files instead of getting like (rotworm = 40 x 250) "all monsters under 1500 exp", cause that would totaly bug when your players are at 2-3x the exp"
 
It's not that hard to do the only thing is that for every monster you want it to be able to drop one of those bags you'd have to add some text in their monster file which if you will be having like 100+ different monsters being able to drop those bags is alot of work.
 
creaturescript/script

script name.lua
PHP:
function onKill(cid, target)
local percent = 30
if isPlayer(cid) and isMonster(target) then
if math.random(1,100) <= percent then
local exp = getMonsterInfo(string.lower(getCreatureName(target))).experience
if exp < 6000 then -- exp
doPlayerAddItem(cid, 6570, 1) -- blue 
else
doPlayerAddItem(cid, 6571, 1) -- red
end
doSendMagicEffect(getPlayerPosition(cid), math.random(29,30))
end
else
return TRUE
end
return TRUE
end

creaturescript.xml
Code:
<event type="kill" name="EventMob" event="script" value="script name.lua"/>

login.lua add:

Code:
registerCreatureEvent(cid, "EventMob")
 
Back
Top