What's new

[x.x]Arena svargrond

Status
Not open for further replies.

mol1818

Active User
Joined
Dec 31, 2008
Messages
143
Reaction score
20
Witam mam arene svarground by gesior. skopiowalem ja na swoja mape dodalem wszystko jak nalezy i dziala,ale gdy pokonam ostatniego stworka i wyskakuje "Mozesz wejsc do kolejnego pokoju areny!" jak co poziom i gdy wchodze w tp wyskakuje "Zrobiles arene na poziomie 1! Idz i wybierz nagrode." ale mnie przenosi do tego miejsca gdzie jestem gdy wyjde z areny, a nie do pomieszczenia z pokojami z nagrodami. kto mi pomoze??

//Przenosz? do Pomoc z OT!
 
Last edited by a moderator:

arts1991

Advanced User
Joined
Apr 21, 2008
Messages
375
Reaction score
34
Age
33
Odp: Arena svarground

Odp: Arena svarground

Ustaw prawdziwe kordynaty w skrypcie.
Nie wiem ktora to linijka , ale tam gdzie jest po pokonaniu ostatniego potworka masz linijk? gdzie trzeba wpisa? wsp??rz?dne.
Mam nadziej? ?e pomog?em.
Pozdrawiam ;]
 

mol1818

Active User
Joined
Dec 31, 2008
Messages
143
Reaction score
20
Odp: Arena svarground

Odp: Arena svarground

wlasnie zeby wpisac wspolrzedne to jest tylko jedno miejsce w global.lua do wyjscia z areny a moze lepiej bedzie jesli wkleje tu czesc skryptow:
arenaward.lua
HTML:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
		local reward = 0
		if item.actionid == 42361 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 2114, 1)
		elseif item.actionid == 42362 then
			reward = doCreateItemEx(7406,1)
		elseif item.actionid == 42363 then
			reward = doCreateItemEx(7380,1)
		elseif item.actionid == 42364 then
			reward = doCreateItemEx(7392,1)
		elseif item.actionid == 42365 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 7365, 100)
			doAddContainerItem(reward, 7364, 100)
		end
		local additem = doPlayerAddItemEx(cid, reward, 0)
		if additem == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Znalazles ' .. getItemName(getThing(reward).itemid) .. '.')
			setPlayerStorageValue(cid, 42361, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Nie masz dosc miejsca w backpacku lub udzwigu, aby uniesc ten przedmiot.')
		end
	elseif item.actionid >= 42371 and item.actionid <= 42375 and getPlayerStorageValue(cid, 42371) ~= 1 then
		local reward = 0
		if item.actionid == 42371 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 7183, 1)
		elseif item.actionid == 42372 then
			reward = doCreateItemEx(7384,1)
		elseif item.actionid == 42373 then
			reward = doCreateItemEx(7389,1)
		elseif item.actionid == 42374 then
			reward = doCreateItemEx(7415,1)
		elseif item.actionid == 42375 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 7365, 100)
			doAddContainerItem(reward, 2547, 100)
			doAddContainerItem(reward, 2547, 100)
			doAddContainerItem(reward, 2311, 50)
			doAddContainerItem(reward, 2304, 50)
		end
		local additem = doPlayerAddItemEx(cid, reward, 0)
		if additem == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Znalazles ' .. getItemName(getThing(reward).itemid) .. '.')
			setPlayerStorageValue(cid, 42371, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Nie masz dosc miejsca w backpacku lub udzwigu, aby uniesc ten przedmiot.')
		end
	elseif item.actionid >= 42381 and item.actionid <= 42385 and getPlayerStorageValue(cid, 42381) ~= 1 then
		local reward = 0
		if item.actionid == 42381 then
			reward = doCreateItemEx(1990,1)
			doAddContainerItem(reward, 7372, 1)
			doAddContainerItem(reward, 6569, 10)
			doAddContainerItem(reward, 6574, 1)
			doAddContainerItem(reward, 6568, 1)
		elseif item.actionid == 42382 then
			reward = doCreateItemEx(7429,1)
		elseif item.actionid == 42383 then
			reward = doCreateItemEx(7434,1)
		elseif item.actionid == 42384 then
			reward = doCreateItemEx(7390,1)
		elseif item.actionid == 42385 then
			reward = doCreateItemEx(7342,1)
			doAddContainerItem(reward, 2273, 50)
			doAddContainerItem(reward, 2268, 50)
			doAddContainerItem(reward, 7443, 1)
			doAddContainerItem(reward, 7440, 1)
			doAddContainerItem(reward, 6529, 100)
		end
		local additem = doPlayerAddItemEx(cid, reward, 0)
		if additem == RETURNVALUE_NOERROR then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Znalazles ' .. getItemName(getThing(reward).itemid) .. '.')
			setPlayerStorageValue(cid, 42381, 1)
		else
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Nie masz dosc miejsca w backpacku lub udzwigu, aby uniesc ten przedmiot.')
		end
	end
	return TRUE
end
leavearena.lua
HTML:
function onStepIn(cid, item, pos, fromPosition)
	if getPlayerStorageValue(cid, 42309) < 1 then
		for i = 42300, 42309 do
			setPlayerStorageValue(cid, i, 0)
		end
	end
	-- if he did not make full arena 2 he must start from zero
	if getPlayerStorageValue(cid, 42319) < 1 then
		for i = 42310, 42319 do
			setPlayerStorageValue(cid, i, 0)
		end
	end
	-- if he did not make full arena 3 he must start from zero
	if getPlayerStorageValue(cid, 42329) < 1 then
		for i = 42320, 42329 do
			setPlayerStorageValue(cid, i, 0)
		end
	end
	doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Wyszedles z areny!')
	doTeleportThing(cid, arenaKickPosition, TRUE)
	setGlobalStorageValue(item.actionid-21, 0) -- free room
	setPlayerStorageValue(cid, 42350, os.time()+5) -- time to kick 0
	setPlayerStorageValue(cid, 42352, 0) -- is not in arena
	return TRUE
end
didarenalevel.lua
HTML:
function onStepIn(cid, item, pos, fromPosition)
	if getPlayerStorageValue(cid, item.actionid+getPlayerStorageValue(cid, 42355)*10-1) == 1 then
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'Zrobiles arene na poziomie '.. getPlayerStorageValue(cid, 42355)+1 ..'! Idz i wybierz nagrode.')
		setPlayerStorageValue(cid, 42355, getPlayerStorageValue(cid, 42355)+1) --did arena level X
		setPlayerStorageValue(cid, item.actionid+getPlayerStorageValue(cid, 42355)*10, 1) --did arena level X
		setGlobalStorageValue(item.actionid-1, 0) -- room free
		setPlayerStorageValue(cid, 42350, os.time()+5) -- time to kick 0
		setPlayerStorageValue(cid, 42352, 0) -- is not in arena
		doTeleportThing(cid, arenaKickPosition, TRUE)
	else
		doTeleportThing(cid, fromPosition, TRUE)
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Najpierw zabij potwora!')
	end
	return TRUE
end
arenaroom.lua
HTML:
function onStepIn(cid, item, position, fromPosition)
	if InitArenaScript == 0 then
		InitArenaScript = 1
		checkArenaRooms({})
	end
	local arena_room = item.actionid
	local player_arena = getPlayerStorageValue(cid, 42355)
	if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then
		if getGlobalStorageValue(cid, arena_room) == 0 then
			local monster_uid = getGlobalStorageValue(arena_room+100)
			if monster_uid > 0 then
				if isCreature(monster_uid) == TRUE then
					doRemoveCreature(monster_uid)
				end
			end
			local spawn_pos = getThingPos(arena_room)
			local monster = doSummonCreature(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})
			setGlobalStorageValue(arena_room+100, monster)
			doTeleportThing(cid, spawn_pos, TRUE)
			setGlobalStorageValue(arena_room, cid)
			setGlobalStorageValue(arena_room-1, 0)
			setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)
		else
			doTeleportThing(cid, fromPosition, TRUE)
			doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' jest teraz w tym pokuj. Zaczekaj chwile.')
		end
	else
		doTeleportThing(cid, fromPosition, TRUE)
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Najpierw zabij potwora!')
	end
	if arena_room == 42300 then
		setPlayerStorageValue(cid, 42351, 0)
		setPlayerStorageValue(cid, 42352, 1)
	end
	return TRUE
end
function checkArenaRooms(param)
	addEvent(checkArenaRooms, 1000, {})
	for i = 42300, 42309 do
		local player = getGlobalStorageValue(i)
		if isPlayer(player) == TRUE then
			local player_storage = getPlayerStorageValue(player, 42350)
			if player_storage <= os.time() then
				doTeleportThing(player, arenaKickPosition, TRUE)
				setPlayerStorageValue(player, 42350, 0)
				setGlobalStorageValue(i, 0)
				doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_ORANGE,'Zostales wyrzucony z areny!')
			elseif player_storage - 10 <= os.time() then
				doPlayerSendTextMessage(player,MESSAGE_EVENT_DEFAULT,'Masz ' .. player_storage - os.time() .. ' sekund, zeby przejsc do kolejnego pokoju!')
			end
		else
			setGlobalStorageValue(i, 0)
		end
	end
end
noi jeszcze to z global.lua gdzie sie wpisuje wyjscie z areny
HTML:
-- arena script
InitArenaScript = 0
arena_room_max_time = 240
arenaKickPosition = {x=811, y=171, z=7} -- position where kick from arena when you leave/you did arena level
arena_monsters = {}
arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
arena_monsters[42301] = 'bloodpaw'
arena_monsters[42302] = 'bovinus'
arena_monsters[42303] = 'achad'
arena_monsters[42304] = 'colerian the barbarian'
arena_monsters[42305] = 'the hairy one'
arena_monsters[42306] = 'axeitus headbanger'
arena_monsters[42307] = 'rocky'
arena_monsters[42308] = 'cursed gladiator'
arena_monsters[42309] = 'orcus the cruel'
arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
arena_monsters[42311] = 'avalanche'
arena_monsters[42312] = 'the dark dancer'
arena_monsters[42313] = 'the hag'
arena_monsters[42314] = 'slim'
arena_monsters[42315] = 'grimgor guteater'
arena_monsters[42316] = 'drasilla'
arena_monsters[42317] = 'spirit of earth'
arena_monsters[42318] = 'spirit of water'
arena_monsters[42319] = 'spirit of fire'
arena_monsters[42320] = 'webster' -- first monster from 3 arena
arena_monsters[42321] = 'darakan the executioner'
arena_monsters[42322] = 'norgle glacierbeard'
arena_monsters[42323] = 'the pit lord'
arena_monsters[42324] = 'svoren the mad'
arena_monsters[42325] = 'the masked marauder'
arena_monsters[42326] = 'gnorre chyllson'
arena_monsters[42327] = "fallen mooh'tah master ghar"
arena_monsters[42328] = 'deathbringer'
arena_monsters[42329] = 'the obliverator'
function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
        end
    end
    return 0
end
to jestczesc skryptow poniewaz reszta to napewno niejest to
a wiec prosze was o pomoc bardzo mi na tym zalezy
 
Status
Not open for further replies.
Top