Scrypt yalaharian quest

Status
Zamknięty.

0KozaczeK0

Active User
Zarejestrowany
Dołączył
Kwiecień 26, 2010
Posty
122
Liczba reakcji
12
Czesc chcial bym zrobic cos takiego ze jak sie stanie w danym miejscu w np.6 osob nacisnie dzwignie to przenosi nas do danego miejsca i twozy sie potworek. (to umiem)
A gdy zabijemy tego potworka pojawia sie teleport na 30sekund : )
Czy byl by w stanie ktos mi pomudz? (wiem ze tak sie da)
Daje reputacje !

Pozdrawiam.

Notka moderatorska:
Przenosz?
 
Odp: Scrypt yalaharian quest

W data/creaturescripts/scripts/login.lua dodajesz :
registerCreatureEvent(cid, "monsterPortals")

W data/creaturescripts/creaturescripts.xml dodajesz :
<event type="kill" name="monsterPortals" event="script" value="script.lua"/>

W data/creaturescripts/scripts/script.lua dodajesz :
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }
}

local time = 30 -- Seconds
function onKill(cid, target, lastHit)
for name, pos in pairs(bosses) do
if (name == getCreatureName(target):lower()) then
doCreateTeleport(1387, pos[1], pos[2])
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos[2], 1387).uid, 1)
end
end
return true
end

A je?eli tak nie umiesz to r?b jak poni?ej.
W creature scripts dodajesz :
<event type="death" name="<nazwa potwora>" script="<nazwa potwora>.lua"/>

W creaturescripts/scripts dodajesz plik <nazwa potwora>.lua a w ?rodku wklejasz :
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "<nazwa potwora>")
local creaturename = getCreatureName(cid)
--- miejsce gdzie tp zostanie utworzone
local pos1 = {x=338, y=1837, z=5, stackpos=2}
--- gdzie teleport Cie teleportuje:
local pos2 = {x=398, y=1928, z=5, stackpos=1}
local time_to_pass = 180 -- czas po jakim zniknie tp w sekundach
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "Well done! Teleport appeared in the middle of room. You got 3 minuts to get into or it will dissapear!."
if creaturename == '<nazwa potwora>' then
teleport = doCreateTeleport(tpID, pos2, pos1)
doSendMagicEffect(pos1, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInBossWard, (1000*time_to_pass))
end
end
function removeTeleportInBossWard()
--- miejsce gdzie tp zostanie utworzone
if getThingfromPos({x=338, y=1837, z=5, stackpos=1}).itemid == 5023 then
--- miejsce gdzie tp zostanie utworzone
doRemoveItem(getThingfromPos({x=338, y=1837, z=5, stackpos=1}).uid,1)
--- miejsce gdzie tp zostanie utworzone
doSendMagicEffect({x=338, y=1837, z=5, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

Nastepnie wchodzisz w plik Twojego potworka (data/monsters/nazwa.xml) i mi?dzy lootem a odg?osami dodajesz :
<script>
<event name="<nazwa potwora>"/>
</script>

Pozdrawiam!
 
Odp: Scrypt yalaharian quest

Wielkie dzieki dziala jak powinno ; )

Daje repucik ;D

Pozdrawiam.
 
Status
Zamknięty.
Back
Do góry