Gdy boss zginie pojawia si? tp

Status
Zamknięty.

Find3R

Active User
Zarejestrowany
Dołączył
Listopad 2, 2010
Posty
52
Liczba reakcji
1
Mam problem poniewa? mam ten skrypt:
Kod:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "Golgordan")
local creaturename = getCreatureName(cid)
--- miejsce gdzie tp zostanie utworzone
local pos1 = {x=1403, y=1099, z=11, stackpos=2}
--- gdzie teleport Cie teleportuje:
local pos2 = {x=1422, y=1100, z=12, stackpos=1}
local time_to_pass = 15 -- czas po jakim zniknie tp w sekundach
local tpID = 1387
local doEffect = CONST_ME_ENERGYHIT
local message = "Well done! Teleport appeared in the middle of room. You got 15 secunds to get into or it will dissapear!."
if creaturename == 'Golgordan' then
teleport = doCreateTeleport(tpID, pos2, pos1)
doSendMagicEffect(pos1, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInBossWard, (15*time_to_pass))
end
end
function removeTeleportInBossWard()
--- miejsce gdzie tp zostanie utworzone
if getThingfromPos({x=1403, y=1099, z=11, stackpos=1}).itemid == 1387 then
--- miejsce gdzie tp zostanie utworzone
doRemoveItem(getThingfromPos({x=1403, y=1099, z=11, stackpos=1}).uid,1)
--- miejsce gdzie tp zostanie utworzone
doSendMagicEffect({x=1403, y=1099, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
Ale gdy zabije bossa to pojawia si? tp , ale nie znika !!Czego to mo?e by? wina!! PLX POM??CIE DAM KA?DEMU REPUTA!
 
Odp: Gdy boss zginie pojawia si? tp

Je?eli u?ywasz TFS 0.4 to zmie? skrypt ; P
Na TFS 0.3.6 te? powinien ?miga? ...
Skoro Golgordan to znaczy ?e skrypt na INQ.

Skrypt
local config = {
timeToRemove = 180, -- seconds
message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear",
teleportId = 9773,
bosses = { -- Monster Name, Teleport Position
["Ushuriel"] = { pos={ x=33157, y=31725, z=11, stackpos=1 }, aid=1001 },
["Zugurosh"] = { pos={ x=33123, y=31689, z=11, stackpos=1 }, aid=1002},
["Madareth"] = { pos={ x=33194, y=31768, z=11, stackpos=1 }, aid=1003},
["Annihilon"] = { pos={ x=33200, y=31704, z=11, stackpos=1 }, aid=1005},
["Hellgorak"] = { pos={ x=33107, y=31735, z=11, stackpos=1 }, aid=1006}
},
brothers ={
["Golgordan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 33224, y = 31722, z = 11},
toPos = {x = 33240, y = 31734, z = 11} } }
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end

function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
elseif(config.brothers[getCreatureName(target)]) then
local t = config.brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
return TRUE
end
else
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end
Pozmieniaj pozycje itp.

Do creaturescripts dodaj takie co? :
<event type="kill" name="inquisitionPortals" script="Inquisition.lua"/>

Do login.lua
registerCreatureEvent(cid, "inquisitionPortals")

Powinno zadzia?a? ; )
 
Odp: Gdy boss zginie pojawia si? tp

Krew mnie zalewa jak ludzie tworzycie tak d?ugie kody pytam ja si? po cholere.

Udost?pniam sw?j.
PHP:
local config = { 
		message = "Go into the teleporter in 3 minutes, else it will disappear.", 
		timeToRemove = 180, -- seconds 
		teleportId = 1387, 
		bosses = { -- Monster Name, Teleport To Position, Teleport Position 
			["Ushuriel"] = { { x=1197, y=2020, z=12 }, { x=1140, y=2095, z=12, stackpos=1 } }, 
			["Zugurosh"] = { { x=1153, y=2032, z=12 }, { x=1174, y=2094, z=12, stackpos=1 } }, 
			["Madareth"] = { { x=1070, y=2085, z=13 }, { x=1137, y=2121, z=12, stackpos=1 } }, 
			["Latrivan"] = { { x=1179, y=2074, z=13 }, { x=1172, y=2125, z=12, stackpos=1 } },
			["Annihilon"] = { { x=1270, y=2178, z=12 }, { x=1212, y=2079, z=12, stackpos=1 } }, 
			["Hellgorak"] = { { x=1090, y=2189, z=13 }, { x=1217, y=2121, z=12, stackpos=1 } }, 
		} 
	} 

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

	function onKill(cid, target, lastHit) 
		if lastHit == true then 
			local position = getCreaturePosition(target) 
			for name, pos in pairs(config.bosses) do 
				if name == getCreatureName(target) then 
					teleport = doCreateTeleport(config.teleportId, pos[1], pos[2]) 
					doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1) 
					addEvent(removal, config.timeToRemove * 1000, pos[2]) 
					doSendMagicEffect(pos[2], 10) 
				end 
			end 
		end 
		return TRUE 
	end
 
Status
Zamknięty.
Back
Do góry