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

[Request] % to recieve an outfit/mount when killing a monster

ItWasAllMe

Banned User
Joined
Feb 15, 2013
Messages
269
Reaction score
32
Hello! I would like a creaturescript that has a low % to give the player that kills the monster an addon or a mount.
Could anyone make this for me? I think it would be a nice script for custom servers :)
 
-- ver. 0.1 2013-07-12, otland.net/members/andypsylon

XMl/outfits.xml
XML:
<outfit id="11" premium="yes" default="0">
	<list gender="0" lookType="150" name="Oriental" />
	<list gender="1" lookType="146" name="Oriental" />
</outfit>
creaturescripts/creaturescripts.xml
XML:
<event type="kill"		name="onKillMobAddon"	event="script" value="my/onKill_Addon.lua"/>
creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "onKillMobAddon")
creaturescripts/scripts/my/onKill_Addon.lua
Lua:
function onKill(cid, target, damage, flags)
	if isPlayer(target) or not isPlayer(cid) or isSummon(target) then return true end

	local mob = {
			["nomad"] = {11, 0, 20},	-- outfit ID, addon NR (0-3, 3 for all addons), chance %
			["rat"] = {12, 1, 95},
			["cave rat"] = {12, 2, 99}
		}

	local m = mob[string.lower(getCreatureName(target))]
	
	if m and math.random(100) <= m[3] then
		doPlayerAddOutfitId(cid, m[1], m[2])
	end

	return true
end
 
Back
Top