SphereCommunity

Full Version: Reactivate/Respawn all
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there! I just want a script to reactivate all the Worldgem bits in the world (double click all the Worldgem in the world) because I have changed the names of all NPC's and others.

How can I do?

I tried something from the Wiki but it didn't work

Code:
[FUNCTION redospawns]
GO 1,1
FOR 0 1 //make loop through all 5 maps
    MAP = <LOCAL._FOR> //set the map
    FORCHARS 8000 //loop through all chars in the world (unless EA makes a map bigger than 8000x8000 squares)
        REF1 = <MEMORYFINDTYPE.memory_ispawned.LINK> //set REF1 to the spawngem of that npc
        IF (<REF1>) //checks if the npc has the spawn memory
            REF1.TIMER = <EVAL {<REF1.MOREX> <REF1.MOREY>} * 60> //set the spawn memory timer to the values specified when creating it
        ENDIF
    ENDFOR
ENDFOR

Thanks Smile
BTW [I always search in the forums first but I don't get this :'(]
Well change the forchars check with foritems e.g. :

Code:
foritems 8000
    if (<baseid> == i_worldgem_bit)
    dclick //<- deactivate
        timer 0 // <- reactivate
    endif
endfor

this is very simple but it will work, you can make it better Smile
(03-06-2015 06:10 PM)JohnVeritas Wrote: [ -> ]Well change the forchars check with foritems e.g. :

Code:
foritems 8000
    if (<baseid> == i_worldgem_bit)
    dclick //<- deactivate
        timer 0 // <- reactivate
    endif
endfor

this is very simple but it will work, you can make it better Smile

I just want to do it 1 time or 2. So, if this works, is fine Smile

Thanks !

EDIT: 'you can't see the target' errors.
I'm in gm.
[FUNCTION renegotiate]
FORINSTANCES i_worldgem_bit
USE 0
USE 0 //second one makes the first monster spawn instead of waiting for the timer to count down
ENDFOR
(03-07-2015 07:15 AM)richm Wrote: [ -> ][FUNCTION renegotiate]
FORINSTANCES i_worldgem_bit
USE 0
USE 0 //second one makes the first monster spawn instead of waiting for the timer to count down
ENDFOR

It stucks the server and not works o.O

EDIT: oh wait Shock
What version do you use? Im using a recent version and it works fine. If you have many spawns it might hang your client temporarily (it does on mine) but it does work... ?
(03-07-2015 07:29 AM)richm Wrote: [ -> ]What version do you use? Im using a recent version and it works fine. If you have many spawns it might hang your client temporarily (it does on mine) but it does work... ?

I had main threads problems because use it. :'(

Let me see one more time.

EDIT: still main thread problems.

I have the spawns of the spawners in the forums Tongue [OSI LIKE] and just in the map 0
[function spawnremove]
forchars 65000
if (<npc>)
remove
endif
endfor

[function respawn]
foritems 65000
if (<baseid> == i_worldgem_bit)
timer 0
endif
endfor
(03-07-2015 10:16 AM)azmanomer Wrote: [ -> ][function spawnremove]
forchars 65000
if (<npc>)
remove
endif
endfor

[function respawn]
foritems 65000
if (<baseid> == i_worldgem_bit)
timer 0
endif
endfor

have to use like 5 or 6 times each function but works perfectly Smile

Thanks!
Reference URL's