What's new

Creaturescripts Zabij, a pojawi si? teleport!

Status
Not open for further replies.

Matt

Banned
Joined
May 9, 2013
Messages
595
Reaction score
46
Hej.
Zapewne gdzie? ju? jest taki skrypt lecz postanowi?em sobie doda? m?j, zmodyfikowany.

Opis: Je?li zabijesz ustalonego przez Was potworka to na jego miejscu pojawia si? teleport, kt?ry przenosi nas w ustalone przez nas miejsce.
Skrypt:

data/creaturescripts/scripts/ tworzymy nowy plik boss.lua i wklejamy:
PHP:
local monster = {"demon"} 
local message = "Teraz masz 2 minuty, aby opuscic ten pokoj wchodzac do teleportu."
local teleports = { 
{x=588, y=1086, z=7, stackpos=1},  --pozycja, gdzie prowadzi teleport tworzony po zabiciu demona 
} 
local czas = 120  -- Czas w sekundach do znikniecia teleportu 
function onKill(cid, target) 
    local monster = string.lower(getCreatureName(target)) 
    for i = 1, #monster do 
        if(monster[i] == monster) then 
            local pos = getCreaturePosition(target) 
            local teleport = doCreateTeleport(1387, teleports[i], pos) 
            doSendMagicEffect(getCreaturePosition(target, doEffect))
            doCreatureSay(cid, message, TALKTYPE_ORANGE_1) 
            param = {teleport} 
            addEvent(removeTeleport, (1000*czas),param) 
            return TRUE 
        end 
    end 
    return TRUE 
end  
function removeTeleport(param) 
if param[1].itemid == 1387 then 
    doRemoveItem(param[1].uid,1) 
end 
end

nast?pnie do creaturescripts.xml pod:
PHP:
<creaturescripts>
wklejamy:
PHP:
<event type="kill" name="Boss" event="script" value="boss.lua"/>


Jeszcze przejd? do data/monster i edytuj plik Demon.xml i dodaj pod </flags>:
PHP:
<script>
<event name="boss"/>
</script>

Ostatnia rzecz, przejd? do data/creaturescripts/scripts/login.lua, pod "function onLogin(cid)" wklej:
PHP:
registerCreatureEvent(cid, "boss")


To tyle, ?ycz? mi?ego u?ytku.

Pozdrawiam,
Matt.
 

Xevis

Senior User
Joined
May 28, 2008
Messages
836
Reaction score
54
Odp: Zabij, a pojawi si? teleport!

pod jakiego reva dzia?a?
 

Matt

Banned
Joined
May 9, 2013
Messages
595
Reaction score
46
Odp: Zabij, a pojawi si? teleport!

No raczej na ka?dym tfs.
 

Matt

Banned
Joined
May 9, 2013
Messages
595
Reaction score
46
Odp: Zabij, a pojawi si? teleport!

onKill to jest trigger, jest od 7.6 w tfsach, czyli jest wywo?ywana przez silnik.
 

darchior

Advanced User
Joined
Jul 1, 2011
Messages
315
Reaction score
23
Age
26
Odp: Zabij, a pojawi si? teleport!

Nie dzia?a ^^ po co dodajesz nietestowany skrypt ?
 

DD Soba

Advanced User
Joined
Jun 6, 2010
Messages
316
Reaction score
10
Age
30
Odp: Zabij, a pojawi si? teleport!

U mnie dzia?a :]
 
Status
Not open for further replies.
Top