What's new

tp

matek53

Active User
Joined
Aug 12, 2009
Messages
53
Reaction score
0
Pojawiajonce sie tp po zabiciu np azerusa w miejscu x,y,z na 30 sec telepoltujonce w miejsce xx,yy,zz;)
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: tp

Robisz w creaturescripts plik o nazwie "Azerus.lua" i wklejasz:
Code:
local config = {
	message = "Go into the teleporter in 30 seconds, else it will disappear.",
	timeToRemove = 30, -- seconds
	teleportId = 1387,
	bosses = {
		["Azerus"] = [color=red]{x=xxx, y=yyy, z=z},[/color]

	}
}

local function removal(position)
	position.stackpos = 1
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "azerus")
	local position = getCreaturePosition(cid)
	
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos, position)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE
end
Na czerowno pozycja gdzie przeteleportuje gracza.

A w creaturescripts.xml:
Code:
<event type="death" name="azerus" script="Azerus.lua"/>
 

matek53

Active User
Joined
Aug 12, 2009
Messages
53
Reaction score
0
Odp: tp

nei dzia? nie zostaje tereportowani ani nie robi sie w tym miejscu tereport :(
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: tp

Czytaj teraz uwa?nie:
Code:
["Azerus"] = {x=xxx, y=yyy, z=z},
To miejsce jest wa?ne. Musisz mie? potwora o nazwie Azerus (KONIECZNIE Z DU?EJ LITERY) i posiada? go na mapie.
Druga sprawa, to jest funkcja kt?r? MUSISZ ZAPISA? W CREATURESCRIPTS A NIE W ACTIONS!!!
Teraz sprawd? ^^
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: tp

Ja testowa?em na TFS 0.3.4pl2 i TFS 0.3.5 i wszystko dzia?a?o. Podam Ci m?j skrypt.
Code:
local config = {
	message = "Go into the teleporter in 3 minutes, else it will disappear.",
	timeToRemove = 180, -- seconds
	teleportId = 1387,
	bosses = {
		["Orshabaal"] = {x=132, y=148, z=7},
		["Snow Spectre"] = {x=141, y=148, z=7},
		["the handmaiden"] = {x=125, y=138, z=7},
		["massacre"] = {x=144, y=135, z=7},
	}
}

local function removal(position)
	position.stackpos = 1
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "inquisitionPortals")
	local position = getCreaturePosition(cid)
	
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos, position)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE
end
 
Top