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

Domination of the Castle ! read...

ka9

New Member
Joined
Jul 25, 2009
Messages
32
Reaction score
0
Well, I'm with my system of domination of the castle, and I wanted
add an item to the leader of the winning guild.


here is the script


Code:
function onDeath(cid, corpse, deathList)
	local msg, topGuild, topHits = "", "", 0
	for guild, hits in pairs(MONSTER_ATTACKERS_GUILD) do
		msg = msg.."Guild: "..guild.." Hits: "..hits.."\n"
		if hits > topHits then
			topGuild = guild
			topHits = hits
		end
	end

	doBroadcastMessage("[Castle Event] The Guild "..topGuild.." domination the castle !")
	local gid = getGuildId(topGuild)
	setGlobalStorageValue(gid, 29002, -1)
	setGlobalStorageValue(29002, gid)
	setGlobalStorageValue(5181, 0)
	MONSTER_ATTACKERS_GUILD = {}
	return TRUE
end
function onStatsChange(cid, attacker, type, combat, value)
	local player = isPlayer(attacker) and attacker or getCreatureMaster(attacker)
	if isPlayer(player) and getPlayerGuildId(attacker) ~= 0 and type == STATSCHANGE_HEALTHLOSS then
		local name = getPlayerGuildName(attacker)
		if not MONSTER_ATTACKERS_GUILD[name] then
			MONSTER_ATTACKERS_GUILD[name] = 0
		end
		
		MONSTER_ATTACKERS_GUILD[name] = MONSTER_ATTACKERS_GUILD[name] + value
	end
	
	return TRUE
end

Help-me. :D
 
Back
Top