• 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] special war script

Yony

New Member
Joined
Sep 7, 2007
Messages
318
Reaction score
0
Location
Israel
Well I need script that will go like this:
If you are 1-4 vocation ID and you kill 5-8 vocation ID you get experience
and the same as for the other.

(This is only example)
 
Last edited:
Lua:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)

	if level < 160 then 
		exp = 5000000
	elseif level > 159 and level < 170 then
		exp = 6000000
	elseif level > 169 and level < 180 then
		exp = 7000000
	elseif level > 179 and level < 190 then
		exp = 8000000
	else -- level 200+
		exp = 9000000
	end
               
        if (isInArray({1,2,3,4}, getPlayerVocation(cid)) == TRUE) and (isInArray({5,6,7,8}, getPlayerVocation(target)) == TRUE) then
                doPlayerAddExp(mostDamageKiller, exp)
        elseif (isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE) and (isInArray({1,2,3,4}, getPlayerVocation(target)) == TRUE) then
                doPlayerAddExp(mostDamageKiller, exp))
        end
        return TRUE                            
end

Hope it work :thumbup:.

Regards,
Shawak
 
But what is wrong with the last script? I want that to work like the last one.. Please tell me if I need to add something to login.lua or playerdeath.lua or something else so the other script will work
 
Btw still it doesnt working.. it seems that the script is fine.. but i have to add something else

One more thing, can you test the script in your server?
 
data/creaturescript/creaturescripts.xml
PHP:
	<event type="death" name="Kill" event="script" value="kill.lua"/>

Regards,
Shawak
 
Lua:
function onKill(cid, target)
	local experience = 5000000
	if level >= 160 and level < 170 then
		experience = 6000000
	elseif level >= 170 and level < 180 then
		experience = 7000000
	elseif level >= 180 and level < 200 then
		experience = 8000000
	else -- level 200+
		experience = 9000000
	end
	if (isInArray({1,2,3,4}, getPlayerVocation(cid)) and isInArray({5,6,7,8}, getPlayerVocation(target))) or (isInArray({5,6,7,8}, getPlayerVocation(cid)) and isInArray({1,2,3,4}, getPlayerVocation(target))) then
		doPlayerAddExp(cid, experience)
	end
	return TRUE                            
end
What about this? ;] Simple shortening ;/
 
Last edited:
i dont think the problem is with the script.. i think i have to add something like Plaides said.. in login.lua (but its bugging the server)
 
We did like that last time.. And it made a bug in the server... Player which die get into 0 hp and can relog in same place with full hp/mana
 
Back
Top