• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

WarMaster addon

poii

Member
Joined
Nov 11, 2008
Messages
188
Reaction score
8
I want an script that when a player kill 80 players over lvl 100 then he get the war master addon... sorry for bad english if you need me to explain more please tell me.

example...
Player --> Otlander level 100 Sorcerer

Otlander kill Poii(level 100 druid) and this is his 80th kill lvl 100+ so a message "Congratulations you get WarMaster addon!" appear and he both addons
 
I'll help u with ur request. (better explanation)
A script that when a player kills the amount of 80 players (all lv 100+) he get warmaster addon 1 & 2 & the player receives a message : Congratulations! You got warmaster addon!
----
Maybe a creature script? Onkill...
Just helping ;D and if you need, I can translate from Portuguese to English.
-----
Luciano~>~~<~~~~~~~~
 
Try this one, register it in login.lua and add an entry to creaturescripts.xml

LUA:
local config = {
	storage = 215135,
	kills = 80,
	level = 100,
	outfit = {335,336}
}

function onKill(cid, target, lastHit)
	if isPlayer(target) then
		if not(getPlayerLevel(target) >= config.level) then
			return true
		end
		local get = getPlayerStorageValue(cid,config.storage)+1
		if not(get == config.kills)
			for outfit = 1, #config.outfit do
				doPlayerAddOutfit(cid, outfit, 3)
			end
		elseif get < config.kills then
			setPlayerStorageValue(cid,config.storage,math.max(1,get))
		end
	end	
	return true
end
 
okay, my turn
28437-advance-wars-5_640.jpg

creaturescripts.xml
LUA:
<event type="kill" name="warmaster" event="script" value="warmaster.lua">

login.lua
LUA:
registerCreatureEvent(cid, "warmaster")

warmaster.lua
LUA:
local config = {
    storage = 1513,
    kills = 80,
    level = 100,
    outfitID = 22, --warmaster (outfits.xml)
    msg = 'Congratulations! You get the Warmaster Outfit addons for slaying 80 players!'
}

function onKill(cid, target, lastHit)
    if not isPlayer(cid) or not isPlayer(target) or getCreatureStorage(cid, config.storage) >= config.kills then
        return true
    end
    
    if getPlayerLevel(target) >= config.level then
        doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage)+1)
    end
    
    if getCreatureStorage(cid, config.storage) >= config.kills then
        doPlayerAddOutfitId(cid, config.outfitID, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.msg)
    end    
    return true
end

bye
 
@cyber
wow awesome
you got the same script like me, just with 1 other function + bug at set storage.
 
Well not really a bug, but you need to kill 81..
doCreatureSetStorage(cid, config.storage, math.max((getCreatureStorage(cid, config.storage)+1),1))
 
oh well, good to know :thumbup:
Let's make them know how #kills left to gain addons
LUA:
local config = {
    storage = 1513,
    kills = 80,
    level = 100,
    outfitID = 22, --warmaster (outfits.xml)
    msg = 'Congratulations! You get the Warmaster Outfit addons for slaying 80 players!'
}

function onKill(cid, target, lastHit)
    if not isPlayer(cid) or not isPlayer(target) or getCreatureStorage(cid, config.storage) >= config.kills then
        return true
    end
    
    if getPlayerLevel(target) >= config.level then
        doCreatureSetStorage(cid, config.storage, math.max((getCreatureStorage(cid, config.storage)+1),1)) 
        if getCreatureStorage(cid, config.storage) < config.kills then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have to kill '.. config.kills - getCreatureStorage(cid, config.storage) ..' more players to obtain the warmaster addons.')
        end
    end
   
    if getCreatureStorage(cid, config.storage) >= config.kills then
        doPlayerAddOutfitId(cid, config.outfitID, 3)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.msg)
    end    
    return true
end
 
Back
Top