What's new

Skrypt na sale do pvp ! REP

Status
Not open for further replies.

dragon1155

Advanced User
Joined
Sep 22, 2009
Messages
297
Reaction score
1
Witam czy ktos moglby mi dac lub wyjasnic na czym polega skrypt do war room. Tzn sa dwa miejsca na ktorych musza znalazc sie gracze zeby moc sie teleportowac do tej sali za pomoca przesuniecia dzwigni jednego z nich. Za pomoc rep oczywiscie jak zbyt chaotycznie napisalem prosze zglaszac ;p
 

Arts18

Signed...
Joined
May 7, 2009
Messages
2,888
Reaction score
231
Age
33
Odp: Skrypt na sale do pvp ! REP

Masz na my?li arene PVP? Znajdziesz j? w ka?dym silniku OT, ewentualnie szukaj w Evo.

Pozdrawiam.


@down.

Zaraz dam.
 
Last edited:

dragon1155

Advanced User
Joined
Sep 22, 2009
Messages
297
Reaction score
1
Odp: Skrypt na sale do pvp ! REP

u mnie nie ma...nie ma zadnego szybkiego skryptu aby dwojka graczy w danych miejsach jednoczesnie zostala teleportowana w jedno miejsce ?
 

dragon1155

Advanced User
Joined
Sep 22, 2009
Messages
297
Reaction score
1
Odp: Skrypt na sale do pvp ! REP

znalazlem ale nie wiem jak go edytowac na moja mape...
 

Arts18

Signed...
Joined
May 7, 2009
Messages
2,888
Reaction score
231
Age
33
Odp: Skrypt na sale do pvp ! REP

Zapodaj tego tutaj skrypta, zaraz co? si? wykombinuje.
 

dragon1155

Advanced User
Joined
Sep 22, 2009
Messages
297
Reaction score
1
Odp: Skrypt na sale do pvp ! REP

wystarczy ze powiesz po polsku co za co odpowiada co jest co i mysle ze bym sam poradzil sobie :p

function onUse(cid, item, fromPosition, itemEx, toPosition)
local firstPlayerPosition = {x = 539, y = 535, z = 8, stackpos = STACKPOS_TOP_CREATURE}
local getFirstPlayer = getThingFromPos(firstPlayerPosition)
local secondPlayerPosition = {x = 531, y = 535, z = 8, stackpos = STACKPOS_TOP_CREATURE}
local getSecondPlayer = getThingFromPos(secondPlayerPosition)
local arenaLevel = 200
local newFirstPlayerPosition = {x = 535, y = 535, z = 8}
local newSecondPlayerPosition = {x = 535, y = 535, z = 8}
if(item.uid == 7001) then
if(getFirstPlayer.itemid > 0 and getSecondPlayer.itemid > 0) then
if(getPlayerLevel(getFirstPlayer.uid) >= arenaLevel and getPlayerLevel(getSecondPlayer.uid) >= arenaLevel) then
for arenax = 1041, 1052 do
for arenay = 985, 991 do
local arenaPosition = {x=535, y=535, z=8, stackpos=535}
local arenaCreature = getThingFromPos(arenaPosition)
if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == FALSE) then
if(isMonster(arenaCreature.uid) == TRUE) then
doRemoveCreature(arenaCreature.uid)
end
elseif(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
doPlayerSendCancel(cid, "Wait for current duel to end.")
return TRUE
end
end
end
if(item.itemid == 1945) then
doTransformItem(item.uid, 1946)
elseif(item.itemid == 1945) then
doTransformItem(item.uid, 1946)
end
doSendMagicEffect(firstPlayerPosition, 2)
doSendMagicEffect(secondPlayerPosition, 2)
doTeleportThing(getFirstPlayer.uid, newFirstPlayerPosition)
doTeleportThing(getSecondPlayer.uid, newSecondPlayerPosition)
doSendMagicEffect(newFirstPlayerPosition, 10)
doSendMagicEffect(newSecondPlayerPosition, 10)
doPlayerSendTextMessage(getFirstPlayer.uid, 18, "FIGHT!")
doPlayerSendTextMessage(getSecondPlayer.uid, 18, "FIGHT!")
else
doPlayerSendCancel(cid, "Both fighters must have level 25.")
end
else
doPlayerSendCancel(cid, "You need 2 players for a duel.")
end
end
return TRUE
 

Arts18

Signed...
Joined
May 7, 2009
Messages
2,888
Reaction score
231
Age
33
Odp: Skrypt na sale do pvp ! REP

Pierwsze dwa pozycje pos odpowiadaj? za to gdzie maj? Ci? przenie??, a za? dwie ostatnie pozycje pos odpowiadaj? za wej?cie na kratk?. W razie czego sprawd? sobie na mapce, to powinno Ci pom?c.
 

Venn

Advanced User
Joined
May 10, 2009
Messages
174
Reaction score
5
Odp: Skrypt na sale do pvp ! REP

gdzie stoi pierwszy gracz przed wej?ciem do room
Code:
firstPlayerPosition
gdzie stoi drugi gracz przed wej?ciem do room
Code:
secondPlayerPosition
gdzie teleportuje pierwszego gracza po poci?gni?ciu wajchy
Code:
newFirstPlayerPosition
gdzie teleportuje drugiego gracza po poci?gni?ciu wajchy
Code:
newSecondPlayerPosition
pozycje areny
Code:
for arenax = 1041, 1052
for arenay = 985, 991
pozycje potwora kiedy nikogo nie ma na arenie
Code:
local arenaPosition
na mapie kolo jednego gracza musisz postawi? wajch? z uid
Code:
7001
Je?eli chcesz to tutaj masz prosty mod (po edycji usu? komentarze ?eby dzia?a?o)
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Arena Play Ground" enabled="yes">

<!--<!---->
oldPosition - pozycje graczy przed wej?ciem
newPosition - pozycje graczy gdzie si? znajda po poci?gni?ciu wajchy
arena - pozycje areny(z jednego rogu do przeciwnego)
-->

	<config name="arena_config"><![CDATA[
		config = {
			oldPosition = {
				{x = 1017, y = 1020, z = 7},
				{x = 1017, y = 1021, z = 7}
			},
			newPosition = {
				{x = 1017, y = 1007, z = 7},
				{x = 1025, y = 1016, z = 7}
			},
			arena = {
				fromPos = {x = 1017, y = 1007, z = 7},
				toPos = {x = 1025, y= 1016, z = 7}
			}
		}
	]]></config>
	<event type="login" name="arena_login" event="script"><![CDATA[
		return registerCreatureEvent(cid, "arena_dead")
	]]></event>
	<event type="statschange" name="arena_dead" event="script"><![CDATA[
		domodlib("arena_config")
		if type == 1 and getCreatureHealth(cid) <= value and isCreature(attacker) and isPlayer(cid) then
			if isInRange(getThingPos(cid), config.arena.fromPos, config.arena.toPos) then
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid), false)
				doCreatureAddMana(cid, getCreatureMaxMana(cid), false)
				doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
				return false
			end
		end
		return true
	]]></event>

<!--<!---->
action uniqueid - UID WAJCHY NA MAPIE
-->

	<action uniqueid="1981" event="script"><![CDATA[
		domodlib("arena_config")
		if item.itemid == 1945 then
			return doTransformItem(item.uid, 1946)
		end
		local players = {}
		for _, old in ipairs(config.oldPosition) do
			local creature = getTopCreature(old).uid
			if isPlayer(creature) then
				table.insert(players, creature)
			end
		end
		if #players ~= 2 then
			return doPlayerSendTextMessage(cid, 27, "You need 2 players to start.")
		end
		for i, player in ipairs(players) do
			doSendMagicEffect(getThingPos(player), CONST_ME_POFF)
			doTeleportThing(player, config.newPosition[i], true)
			doSendMagicEffect(config.newPosition[i], CONST_ME_TELEPORT)
		end
		doTransformItem(item.uid, 1945)
		return true
	]]></action>
</mod>
 
Last edited:
Status
Not open for further replies.
Top