Jump to content

How can I spawn a NPC for limited time


Recommended Posts

Hi, I've been working on a quest that when you kill one specific mob, it spawns a NPC.

Well, spawn the NPC was easy, but i can't despawn him:P

I thing that maybe because they are in diferent "prepositions, 'when'..." maybe the purge command can not recognize/link to the summon code or the summoned mob.

Here is my quest.

PS* the Hi! menssage is just to "see" time limit.

 

quest portal_to_forest begin
    state start begin
        when 6405.kill begin
            local x = (pc.get_local_x())
            local y = (pc.get_local_y())
            mob.spawn(9020 , x , y , 1)
            timer("timing", 5)
        end
        when timing.timer begin
            notice_all("Hi!")
            npc.purge()
        end
    end
end

 

I've already tried the following commands:

npc.purge(9020 , x , y , 1)

mob.spawn(9020 , x , y , -1) (I know -_- but maybe it could work...)

npc.kill()

npc.kill(9020 , x , y , 1)

Link to comment
Share on other sites

  • Premium
20 hours ago, Sonitex said:

I suppose you are doing an Arboreal Menace dungeon. You can use these two functions for that. It should work I think :) 


d.set_unique("teleport", d.spawn_mob(9020, pc.get_local_x(), pc.get_local_y()))

d.purge_unique("teleport")

 

Well im trying to do the same think, but that command you gave only works on Devil's Tower, i try on Temple Ochao and did nothing :|

Can you help me ?

Link to comment
Share on other sites

  • Premium
1 hour ago, Red said:

Well im trying to do the same think, but that command you gave only works on Devil's Tower, i try on Temple Ochao and did nothing :|

Can you help me ?

There is no 'map-index' condition for this function to work. As I said, you must enter the map as dungeon for it to work since this is a dungeon based function. Try adding d.in_dungeon() like this to avoid any unnecessary errors:

when kill with d.in_dungeon() begin

Link to comment
Share on other sites

The problem is entering the map asa dungeon...I did it, but is not a commun dongeon, i wanted that to be a common dungeon like GF servers, whene veryone can enter the same map but as a dungeon.

I've tried the warp command with two chars with the following funcions:

d.join() -- warp to the dungeon, but create a unique map just for one.

d.new_jump_all() -- warp to the dungeon, but also create a unique map just for one.

d.jump() -- that just don't work, does nothing...

 

Well I'm out of ideas :P

Link to comment
Share on other sites

  • Bronze
2 hours ago, RcDragon said:

The problem is entering the map asa dungeon...I did it, but is not a commun dongeon, i wanted that to be a common dungeon like GF servers, whene veryone can enter the same map but as a dungeon.

I've tried the warp command with two chars with the following funcions:

d.join() -- warp to the dungeon, but create a unique map just for one.

d.new_jump_all() -- warp to the dungeon, but also create a unique map just for one.

d.jump() -- that just don't work, does nothing...

 

Well I'm out of ideas :P

Maybe you can try

d.new_jump_party() - Group

d.new_jump() - Solo

Link to comment
Share on other sites

42 minutes ago, enzi said:

Maybe you can try

d.new_jump_party() - Group

d.new_jump() - Solo

Yes I know but, I don't want properly a dungeon, I just want the map be considered as a dungeon, because if I use those function, the map will create a dimenssion/channel for that group or player, and none will be able to enter at the same channel as other players/groups. I've treid with two chars, and it work, but those chars are not at the same channel or dimenssion, exactly as Demon Tower, but on GF servers, if u enter the maze, u see other players. Thats my biggest problem.

I've been treying to find a way to spawn and despawn a NPC or MOB without dungeon funcions, but i can't find it, i think that don't exist those funcions, without source edit.

Anyway if someone know how to do that with quest event (game.set_event etc...) or something else plz tell me. I'll be glad as fuck! xD

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.