Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

How can I spawn a NPC for limited time


RcDragon

Question

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

7 answers to this question

Recommended Posts

  • 0
41 minutes 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")

 

Thank you :D

It worked thank you very much

Link to comment
Share on other sites

  • 0
  • 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

  • 0
  • 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

  • 0

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

  • 0
  • Moon
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

  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      Navicat Premium 16.1.1 x64

    2. 5

      problem Dargon Soul Changre Attribute

    3. 5

      problem Dargon Soul Changre Attribute

    4. 41

      Global Chat

    5. 5

      problem Dargon Soul Changre Attribute

    6. 2

      Startup Loading Window Library

    7. 28

      Ludus2: metin2 fan project

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.