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

GlobalEvent [MOD]Full auto WAR-TeamBattle Event(with random rewards)

What could I do wrong in copypasta? :D I think that maybe some code is missing in my lib~... lets wait till the PROs analyse it and give diagnosis, and I hope a solution :p .
 
What could I do wrong in copypasta? :D I think that maybe some code is missing in my lib~... lets wait till the PROs analyse it and give diagnosis, and I hope a solution :p .

character dont die?
 
Could u copy/paste here file 032-position.lua from your data/lib directory? As the error comes from there I'll try to compare them :U.
 
have fun :)
Lua:
function isInRange(position, fromPosition, toPosition)
	return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z)
end

function getDistanceBetween(fromPosition, toPosition)
	local x, y = math.abs(fromPosition.x - toPosition.x), math.abs(fromPosition.y - toPosition.y)
	local diff = math.max(x, y)
	if(fromPosition.z ~= toPosition.z) then
		diff = diff + 9 + 6
	end

	return diff
end

function getDirectionTo(pos1, pos2)
	local dir = NORTH
	if(pos1.x > pos2.x) then
		dir = WEST
		if(pos1.y > pos2.y) then
			dir = NORTHWEST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHWEST
		end
	elseif(pos1.x < pos2.x) then
		dir = EAST
		if(pos1.y > pos2.y) then
			dir = NORTHEAST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHEAST
		end
	else
		if(pos1.y > pos2.y) then
			dir = NORTH
		elseif(pos1.y < pos2.y) then
			dir = SOUTH
		end
	end

	return dir
end

function getCreatureLookPosition(cid)
	return getPosByDir(getThingPos(cid), getCreatureLookDirection(cid))
end

function getPositionByDirection(position, direction, size)
	local n = size or 1
	if(direction == NORTH) then
		position.y = position.y - n
	elseif(direction == SOUTH) then
		position.y = position.y + n
	elseif(direction == WEST) then
		position.x = position.x - n
	elseif(direction == EAST) then
		position.x = position.x + n
	elseif(direction == NORTHWEST) then
		position.y = position.y - n
		position.x = position.x - n
	elseif(direction == NORTHEAST) then
		position.y = position.y - n
		position.x = position.x + n
	elseif(direction == SOUTHWEST) then
		position.y = position.y + n
		position.x = position.x - n
	elseif(direction == SOUTHEAST) then
		position.y = position.y + n
		position.x = position.x + n
	end

	return position
end

function doComparePositions(position, positionEx)
	return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z
end

function getArea(position, x, y)
	local t = {}
	for i = (position.x - x), (position.x + x) do
		for j = (position.y - y), (position.y + y) do
			table.insert(t, {x = i, y = j, z = position.z})
		end
	end

	return t
end
 
When I swapped my 032-position.lua with yours I can't even use /a command on god :D I'll try to copy and paste everything once again.
 
what tfs you use?
i think you just need to replace this with yours or just add
Lua:
function isInRange(position, fromPosition, toPosition)
        return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z)
end
 
Using TFS Crying Damson (0.3.6.3293). After I added function you mentioned it is not displaying errors and teleporting dead people to the temple, but it got bugged before and does not want to finish the battle. How can I reset the whole event?
When I summon this guy and say 'battle' he says this:
12:56 Eventer: Battle will start latter, and it will be broadcaste that you can speak to me.
How do I reset? :p
 
ah you need to reset :)
just change the values of these in mod and in the npc
"runing1,runing2,joined,sto"
 
I changed runing1, runing2, joined and sto in my database but something is still wrong. What are runing1, runing2, joined and sto default values (before the arena match)?
 
Now it fucking works, thanks a lot mate :D . Btw there is a faster way to change values, for example in globalstorage - phpmyadmin.
 

Attachments

Hey I am getting this error, can anyone tell me why? 0.3.6pl1

teambattleerror.jpg


Then I get this if i press ignore:

[06/08/2010 14:46:03] [Lua Error]
[06/08/2010 14:46:03] [string "loadBuffer"]:5: ')' expected near '"..getBlue().."'
[06/08/2010 14:46:03] [Warning - Event::loadScript] Cannot load script (domodlib('tutorial_m')

[06/08/2010 14:46:03] function onThink(interval, lastExecution)
[06/08/2010 14:46:03] if getGlobalStorageValue(running2) == -1 then
[06/08/2010 14:46:03] doBroadcastMessage("The Battle Event is opened.Npc is gathering 2 teams to start event. There is ""..getBlue().."" players in blue team vs ""..getRed().."" players in red team.)
[06/08/2010 14:46:03] return true
[06/08/2010 14:46:03] end
[06/08/2010 14:46:03] return true
[06/08/2010 14:46:03] end
[06/08/2010 14:46:03]
[06/08/2010 14:46:03] )
[06/08/2010 14:46:03] [string "loadBuffer"]:5: ')' expected near '"..getBlue().."'
 
Fixed : I donno how nobody reported this error before :, please recopy the mod part again
 
Must have deleted something when I was configuring the arena and tps. Thanks
 
PHP:
[Error - GlobalEvent Interface]
buffer:onThink
Description:
[string "loadBuffer"]:53: attempt to call global 'getBlue' (a nil value)
stack traceback:
[string "loadBuffer"]:53: in function <[string "loadBuffer"]:51>
[Error - GlobalEvents::think] Couldn't execute event: TeamBattle

Can someone help me?
NPC dont running and i have this /\ error on console.
 
Back
Top