SphereCommunity

Full Version: Spawn Doctor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All
Immaking a little script for the submissions section.
"The spawn doctor" but I need some help.

ForInstances Spawns
Count++
Tag Count
EndFor
Open Dialog
Display Spawn Count, Selection Filters a Range thats variable.
OnButton Search for Spawns
Check Input
CALL Function search for spawns......

^^All was fine until :

I wanted to stop in a loop:

FOR X 1 <TotalSPawnCount>
SpawnNumber = X
Display Spawn Details and Dialog next and last button set X as -2 or 0
Endfor

Or maybe :

FORINSTANCES aSpawn
If Passes all the filters
WHILE (Wait on user input from dialog)
// Tag User With Spawn Parameters to sent to Dialog
// Display SDialog
ENDWHILE
ENDFOR

^^ That wasnt happy.

FORCONTS?
Can I pass a variable with it like FORCONTS X maybe ?

FORINSTANCES?
Could it be a FORCONT with IF BASEID = ARGS or is it different?

I want to stop a FORINSTANCES by either tripping it like X--
or by nesting and spinning a loop inside it; rather than tagging
all the spawns with a number n then having to do a full search of the
world spawns again just to find the Next one tagged n++.

Can I ? Woot
Return 1 ?
when i saw that post first i was terrified, very Big Grin (this part about the post of a forumbot which has lot of text in, probably get deleted when you are reading this).

about the topic, im using forinstances to set spawn timers when i made change (contains some internal functions from my shard):

PHP Code:
[defname spawn_sureleri]
//undeadler
ssure_c_skeleton 2,4
ssure_c_zombie 2
,4
ssure_c_m_skeletonarcher 5
,10
ssure_c_m_skeleton_mage 5
,10
ssure_c_grim_reaper 5
,10
ssure_c_spectre 5
,10
ssure_c_liche 5
,10
ssure_c_mummy 5
,10
ssure_c_m_mummy 5
,10
ssure_c_m_skeleton_knight 2
,8
ssure_c_m_liche_lord 5
,10
ssure_c_headless 2
,4
ssure_c_ghost 2
,4
ssure_c_m_ghoul 2
,4
ssure_c_rotting_corpse 10
,20

//demon vs
ssure_c_daemon 20,25
ssure_c_m_balron 40
,50
ssure_c_balron 60
,120
ssure_c_arcane_demon 2
,4
ssure_c_moloch 5
,10
ssure_c_chaos_demon 2
,4
ssure_c_daemon_w_sword 20
,25
ssure_c_succubus 10
,15
ssure_c_m_imp 5
,10

//exodus
ssure_c_exodus_minion 15,20
ssure_c_iron_golem 15
,20
ssure c_h_controller 10
,15
ssure_c_exodus_minionlord 20
,25

ssure_c_golem_old 50
,60

//dragonlar
ssure_c_dragon_small_black 20,25
ssure_c_dragon_small_red 20
,25
ssure_c_m_dragon_wyrm 25
,30
ssure_c_ancient_wyrm 30
,35
ssure_c_dragon_red 40
,50
ssure_c_serpentine_dragon 100
,120

//elementaller
ssure_c_elem_fire 5,15
ssure_c_elem_earth 5
,15
ssure_c_elem_air 5
,15
ssure_c_elem_water 5
,15
ssure_c_m_elem_blood 5
,15
ssure_c_acid_elemental 5
,15
ssure_c_poison_elemental 5
,15
ssure_c_vortex_sand 5
,15

//devler
ssure_c_titan 5,10
ssure_c_m_cyclops_king 10
,15
ssure_c_cyclops 8
,10
ssure_c_troll_w_axe 2
,5
ssure_c_ogre 2
,6

//gargoyle
ssure_c_destroyer_gargoyle 5,8
ssure_c_enforcer_gargoyle 4
,5
ssure_c_m_gargoyle_stone 5
,10
ssure_c_gargoyle 5
,10

//rahatsız ediciler
ssure_c_spider_giant 5,10
ssure_c_harpy 5
,10
ssure_c_gazer 5
,10
ssure_c_corpser 5
,10
ssure_c_m_scorpion_prince 5
,10
ssure_c_m_scorpion_king 6
,10
ssure_c_m_silver_serpent 2
,6
ssure_c_m_stoneharpy 5
,10
ssure_c_m_efreet 10
,12
ssure_c_m_hellhound 5
,7

//iyi
ssure c_Ethereal_Warrior 10,20

//terathan
ssure_c_m_terathan_avenger 2,6

//orclar
ssure_c_m_goblin_lord 5,10

//lizardlar
ssure_c_lizardman 10,15
ssure_c_lizardman_spear 10
,15
ssure_c_lizardman_mace 10
,15

ssure_c_bog_thing 60
,75

//hayvanlar
ssure_c_sheep_woolly 20,22

[function spawnlari_ayarla]
forinstances i_worldgem_bit
    
if <type> = t_spawn_char
        spawn_sure_ayarla 
    
endif    
endfor

[function 
spawn_sure_ayarla]
if (<
region.isevent.r_firot_dungeon>) 
    
morep=120,120,3
elif 
!(<region.tag0.kale> = 0)    
    
morep=60,70,3
elif 
(<spawn_kayitli_mi>=1)    
    
morep=<def.ssure_<more1>>,3
elif 
!(<serv.chardef.<more1>.tag0.questim> = 0)
    
morep=1,1,3    
else
    
morep=10,15,3    
endif    

[function 
spawn_kayitli_mi
if <
def.ssure_<more1>>
    return 
1
else
    return 

endif    


//also i have command for adding spawns, just type .spawnkoy "char_baseid"  in game

[function spawnkoy]
if (<
account.tag0.spawner> = 0) && (<account.plevel> < 7)
    return 
1
endif

if !(<
serv.chardef.<args>> = 0)
    
smessage <serv.chardef.<args>.namespawnini koyacaginiz noktayi secin:
    
targetfg f_spawnkoy <args>
else
    
flmessage Boyle bir npc yok.    
endif    


[function 
f_spawnkoy]
serv.newitem 01ea7
new.type=34
new.amount=1
new.more=<args>
new.
p=<targp>
new.
attr=00b0
new.morep=5,10,3
new.spawn_sure_ayarla
new.timer 1 
Nice one guys, though I think Ive lead you both up the wrong street !

I would like to increment the loop via user intervention. I do not want to exit the loop (Return 1) untill the user is bored of flicking through spawns, this is what I want to do.

Forinstances i_worldgem_bit
IF Passes the filters (Filters are MORE1 MORE2 and amount)
OPen a Dialog Showing this spawns stats
FOR WHILE Or something I can Spin to stop ForInstances icrementing to the next spawn
and Stay Here untill the user selects next back close or research
ENDFOR
ENDIF
ENDFOR

^^ The Theroy is if we spin the nested loop the main loop will not increment until we exit the nested loop.
What do you all think > Doable or not Doable
i understand now maybe you can do it like this:

[function spawnlari_ayarla]
ref1=<uid>
forinstances i_worldgem_bit
if <type> = t_spawn_char
ref1.ctag.spawn_<dlocal._for>=<uid>
endif
endfor

then you can reach all spawns with a dialog which reads ctags
Thanks Shaklaban, Ive tried this one, but my client was running out of memory and I thought it was the 10000 CTAGS
later I realised there was an error in the loop, so it maybe was not the CTAGS, and I didnt recheck I just went bannanas.

AND <dlocal._for> Geez I never thought of that ! Thanks

So maybe this will work - but it isnt Ideal because -

PHP Code:
[FUNCTION f_SpawnAnalyzer]
REF1=<UID>
LOCAL.SpawnLoopCount=0
FORINSTANCES i_worldgem_bit
     
IF <f_PassesUserFilters>
          
LOCAL.SpawnLoopCount ++  
          
TAG.SpawnNo=<EVAL <LOCAL.SpawnLoopCount>>
          
REF1.CTAG.SpawnSelection_<EVAL <LOCAL.SpawnLoopCount>>=<UID>
     ENDIF
ENDFOR 

Oh Shit this will work it is Ideal !! Because I can now flick through the CTAGS on the player get the UID and do what I like then, and I wont have to LOOP the entire server every time to find SpawnSelection_3_ for example.

Very Nice hopefully the client can handle 1000's of CTAGS ! Ill get back to this later to test it...

Thanks Big Grin

When I went Bannanas I did this.

PHP Code:
[FUNCTION f_SpawnAnalyzerMoreThanAmount]
REF1=<SERV.UID.<ARGV[0]>>
LOCAL.SpawnCounter=0
SERV
.LOG @f_SpawnAnalyzerMoreThanAmount <REF1.NAME>
FORINSTANCES i_worldgem_bit
    
IF <AMOUNT> > <EVAL <REF1.CTAG0.SpawnDoctorAmount>>
        
LOCAL.SpawnCounter ++
        
REF1.GO = <P>
        
REF1.CTAG.SpawnDoctorNext=
        WHILE (!<EVAL <
REF1.CTAG0.SpawnDoctorNext>>)
            
REF1.CTAG.SpawnAnalyzerAmountLT_NUMBER=<EVAL <LOCAL.SpawnCounter>>
            
REF1.CTAG.SpawnAnalyzerAmountLT_<EVAL <LOCAL.SpawnCounter>>_ID=<MORE1>
            
REF1.CTAG.SpawnAnalyzerAmountLT_<EVAL <LOCAL.SpawnCounter>>_AMOUNT=<AMOUNT>
            
REF1.CTAG.SpawnAnalyzerAmountLT_<EVAL <LOCAL.SpawnCounter>>_SPAWNED=<MORE2>
            
REF1.CTAG.SpawnAnalyzerAmountLT_<EVAL <LOCAL.SpawnCounter>>_P=<P>
            
REF1.SDIALOG d_spawnDoctorTweak 1
        
ENDWHILE
        
REF1.CTAG.SpawnDoctorNext=
    ENDIF
ENDFOR 

Then I got looped into trying to pause a loop in the middle of it (If I could something like this it saves 1000 of Ctags)
Reference URL's