Public feed #727202

Untitled

public lua v1 · immutable
Raw Edit
·published 2007-10-05 20:52 UTC
rendered paste body
 --Global Arerna -- g_arena=nil g_player=nil function Arena_OnCreate(arena)	-- Set our global value	g_arena = arena	-- Initialize random	math.randomseed(os.time())end function Player_OnWarpItem(plyr, itemid, target) -- player, integer, string					if (itemid == 3) then			summonall(plyr:coords())		else			plyr:message('You have used an invalid warpitem')		end		return falseendfunction summonall(coords)	local numberOfPlayers = g_arena:numPlaying()	local fighter = {120, 256, 688, 804}	local x = coords.x	local y = coords.y		for i=1, numberOfPlayers do		g_arena:message('Break')		local person = g_arena:get(i)		if (person ~= nil) and (person:valid()) then			if (inArea(fighter, coords) == true) then				person:inventory_modify('Fighter', 1)			end			person:inventory_modify('Summon All', -1)			person:warp(coords.x, coords.y, 0)		end	end	endfunction messagetoteam(team, message)	if (team ~= nil) then		for i=1, team:num() do			local player = team:get(i)			if (player ~= nil) and (player:valid()) then				player:message(message)			end		end	endendfunction Msg_OnCommand(plyr, command, payload, recipient, msg_type) -- player, string, string, string, integer 	if (command == '?coords') then		plyr:message('X = ' .. plyr:coords().x .. ' Y  = ' .. plyr:coords().y)	endendfunction inArea(box, player)	if (player.x >= box[1] and player.x <= box[3] and player.y >= box[2] and player.y <= box[4]) then		return true	else		return false	endend