SphereCommunity
Reactivate/Respawn all - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: Reactivate/Respawn all (/Thread-Reactivate-Respawn-all)



Reactivate/Respawn all - Lazarus - 03-06-2015 03:43 PM

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 :'(]


RE: Reactivate/Respawn all - JohnVeritas - 03-06-2015 06:10 PM

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


RE: Reactivate/Respawn all - Lazarus - 03-07-2015 07:12 AM

(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.


RE: Reactivate/Respawn all - richm - 03-07-2015 07:15 AM

[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


RE: Reactivate/Respawn all - Lazarus - 03-07-2015 07:26 AM

(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


RE: Reactivate/Respawn all - richm - 03-07-2015 07:29 AM

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... ?


RE: Reactivate/Respawn all - Lazarus - 03-07-2015 07:34 AM

(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


RE: Reactivate/Respawn all - azmanomer - 03-07-2015 10:16 AM

[function spawnremove]
forchars 65000
if (<npc>)
remove
endif
endfor

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


RE: Reactivate/Respawn all - Lazarus - 03-07-2015 08:28 PM

(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!