[CD3.55] Problems with Random monster spawm!

XloverBoy7X

LOMCN Veteran
Veteran
Dec 4, 2010
416
101
70
Dundee
I'm trying to make a global script that makes boss appear at random times and at random map...

I wrote this:

[@randomsystem]
#IF
RANDOM 3
#ACT
Goto @opt0

#IF
RANDOM 3
#ACT
Goto @opt1

#IF
RANDOM 3
#ACT
Goto @opt2

[@opt0]
#ACT
Delaygoto [Grobal] 1600 @mob1

[@opt1]
#ACT
Delaygoto [Grobal] 5400 @mob2

[@opt2]
#ACT
Delaygoto [Grobal] 11400 @mob3

[@mob1]
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem

[@mob2]
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 15000 @randomsystem

[@mob3]
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem


So server starts.... it randoms a monster.... monster appear after right delay, everything is perfect... but after some time... 2-3 monsters appear at once not 1 anymore...

When I go back to @randomsystem I want it random once again not 3 at once... and script works fine for most of the day, but once or twice something happens and more than 1 monster appear.

Could some1 spot an error in my script? thanks...
 

Dair

Dedicated Member
Dedicated Member
Dec 7, 2012
13
0
27
Type and test this:

example

[@mob1]
#IF
checkmonmap GreatMaggotLord 1 200
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem
break
#ELSEACT
break


etc.
should be work
 
Last edited:
Upvote 0

Azura

Mir3 Coder & Adviser
Mar 12, 2005
3,249
111
300
Map and cords I would imagine.

The reason you have more then 1 mob spawning id because its checking 3 #IF functions at the same time.

[@randomsystem]
#IF
RANDOM 3
#ACT
Goto @opt0
#ELSEACT
Goto @randomsystem2

[@randomsystem2]
#IF
RANDOM 3
#ACT
Goto @opt1
#ELSEACT
Goto @randomsystem3

[@randomsystem3]
#IF
RANDOM 3
#ACT
Goto @opt2
#ELSEACT
Goto @randomsystem

Not sure if this will give you the right loop, if you remove the last 'Goto' it will work fine, however sometimes no monster will appear.

With the last 'Goto' it should give you a loop until one random is picked.
 
Last edited:
Upvote 0

kaiser86

Dedicated Member
Dedicated Member
Dec 13, 2011
64
0
32
Spain
hello,
do not know if this will help you.
Hope it helps!


[@boss]#Say
<Active boss?/@yes>\
[@yes]
#Say
Activated.\
#ACT
TIMECALL 23 42 @startautoeve
TIMECALL 00 42 @stopautoeve
TIMECALL 17 45 @startautoeve1
TIMECALL 18 45 @stopautoeve1
TIMECALL 18 35 @startautoeve2
TIMECALL 19 30 @stopautoeve2
TIMECALL 19 35 @startautoeve3
TIMECALL 20 30 @stopautoeve3
TIMECALL 19 55 @startautoeve4
TIMECALL 20 50 @stopautoeve4
TIMECALL 13 45 @startautoeve5
TIMECALL 14 45 @stopautoeve5
TIMECALL 13 55 @startautoeve6
TIMECALL 14 50 @stopautoeve6
TIMECALL 08 35 @startautoeve7
TIMECALL 09 30 @stopautoeve7
TIMECALL 10 55 @startautoeve8
TIMECALL 11 50 @stopautoeve8
TIMECALL 11 55 @startautoeve9
TIMECALL 12 50 @stopautoeve9
TIMECALL 00 50 @startautoeve10
TIMECALL 01 50 @stopautoeve10
TIMECALL 05 55 @startautoeve11
TIMECALL 06 50 @stopautoeve11










[@startautoeve]
#act
MonGenP "d1601,100,100,100" (mobb) 1
EventMsg [Grobal] "El poderoso (mobb) Acaba de aparecer." 55






[@stopautoeve]
#act
EventMsg [Grobal] "El poderoso (mobb) se desvanecio." 55


monclear "d1601" "(mobb)"


[@startautoeve1]
#act
MonGenP "d1601,100,100,100" (mobb) 1
EventMsg [Grobal] "El poderoso (mobb) Acaba de aparecer." 55




[@stopautoeve2]
#act
EventMsg [Grobal] "El poderoso (mobb) se desvanecio." 55


monclear "d1601" "(mobb)"
 
Last edited:
Upvote 0

XloverBoy7X

LOMCN Veteran
Veteran
Dec 4, 2010
416
101
70
Dundee
Param yes I used for coordinates and map.

Now Im mixed even more:) got so many answer dunno which one to go with:)))) Thanks guys!!

Azura I wanted to try yours first but It seems to be stopping loop completly and its no random anymore:) most important part is my "randomising function" as I need to have it randomly at different times, then going back to random again and again 1 of 3 opts etc.

I will try Dairs idea first. Hope mob check will stop the other spawns.

and about Kaiser what is timecall for?

I will let you guys know if everything works in 1-2 days, after loop goes few times.

So my new script is:

[@randomsystem]
#IF
RANDOM 3
#ACT
Goto @opt0

#IF
RANDOM 3
#ACT
Goto @opt1

#IF
RANDOM 3
#ACT
Goto @opt2

[@opt0]
#ACT
Delaygoto [Grobal] 1600 @mob1

[@opt1]
#ACT
Delaygoto [Grobal] 5400 @mob2

[@opt2]
#ACT
Delaygoto [Grobal] 11400 @mob3

[@mob1]
#IF
checkmonmap GreatMaggotLord 1 200
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem
break
#ELSEACT
break

[@mob2]
#IF
checkmonmap GreatMaggotLord 1 200
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem
break
#ELSEACT
break

[@mob3]
#IF
checkmonmap GreatMaggotLord 1 200
#ACT
Param1 0
Param2 440
Param3 380
MONGEN GreatMaggotLord 1 200
linemsg [grobal] "GreatMaggotLord appeared!!"
Delaygoto [Grobal] 11000 @randomsystem
break
#ELSEACT
break


ps. Hopefully problem solved> will let you know.
 
Last edited:
Upvote 0

kaiser86

Dedicated Member
Dedicated Member
Dec 13, 2011
64
0
32
Spain
Hello.
the timecall is for the system to activate the script at that time.
eg
timecall 23 42 @ startautoeve
timecall (look at the time the system is)
23 42 (hour and minute)
@ startautoeve (active script)
Hope that helps :)
 
Upvote 0