|
You last visited: Today at 19:34
Advertisement
Random coordinates
Discussion on Random coordinates within the Rappelz Private Server forum part of the Rappelz category.
09/15/2019, 22:13
|
#1
|
elite*gold: 0
Join Date: Dec 2016
Posts: 182
Received Thanks: 82
|
Random coordinates
Hello there. I have an question. I want to add world boss event but don't know why it's not working. What's wrong there? The boss spawning only on last coordinates. Math random does not work. Help me please.
Script:
function get_module_name()
return "server_init"
end
function on_server_init()
-- spawn_xmasprop()
roaming()
rare_mob()
guardian_spawn()
random_respawn()
add_global_prop()
for_event_by_liveteam()
world_boss_server_start_spawn_check()
end
function rare_mob()
world_boss_id = 78000175
x = {153400, 131014, 155520 }
y = {78460, 104179, 77483 }
random_id = math.random(3)
--respawn_rare_mob( -1, 500, 117123, 12361, 3150007, 1, 1 )
respawn_rare_mob( -1, 500,x[random_id],y[random_id], world_boss_id, 1, 1 )
add_event_state(1002,1)
end
|
|
|
09/15/2019, 22:36
|
#2
|
elite*gold: 0
Join Date: Sep 2015
Posts: 603
Received Thanks: 1,201
|
Quote:
Originally Posted by Sandro1029
Hello there. I have an question. I want to add world boss event but don't know why it's not working. What's wrong there? The boss spawning only on last coordinates. Math random does not work. Help me please.
Script:
function get_module_name()
return "server_init"
end
function on_server_init()
-- spawn_xmasprop()
roaming()
rare_mob()
guardian_spawn()
random_respawn()
add_global_prop()
for_event_by_liveteam()
world_boss_server_start_spawn_check()
end
function rare_mob()
world_boss_id = 78000175
x = {153400, 131014, 155520 }
y = {78460, 104179, 77483 }
random_id = math.random(3)
--respawn_rare_mob( -1, 500, 117123, 12361, 3150007, 1, 1 )
respawn_rare_mob( -1, 500,x[random_id],y[random_id], world_boss_id, 1, 1 )
add_event_state(1002,1)
end
|
Because math.random needs 2 numbers. Start and End.
Use math.random(1,3) to create a first-time-random-spawn.
|
|
|
09/15/2019, 22:40
|
#3
|
elite*gold: 0
Join Date: Dec 2016
Posts: 182
Received Thanks: 82
|
Quote:
Originally Posted by InkDevil
Because math.random needs 2 numbers. Start and End.
Use math.random(1,3) to create a first-time-random-spawn.
|
I tried that too. But even with 2 numbers it does not work
By the way.
How to buff all online players via timed buff? Not event_state
|
|
|
09/16/2019, 00:37
|
#4
|
elite*gold: 0
Join Date: Sep 2015
Posts: 603
Received Thanks: 1,201
|
Quote:
Originally Posted by Sandro1029
I tried that too. But even with 2 numbers it does not work
By the way.
How to buff all online players via timed buff? Not event_state
|
I only answered on your question how math.random works to select a random position.
And I also said
Quote:
|
Use math.random(1,3) to create a first-time-random-spawn.
|
respawn_rare_mob won't call math.random again when the monster is respawning. just when server is starting and "registering" the respawner.
If you want to make it random automatically without ScheduledCommand, take a look into random respawn script.
*Hint is given*
The buff-command you're looking for is cast_world_state(id,lv,duration)
|
|
|
09/16/2019, 00:38
|
#5
|
elite*gold: 0
Join Date: Dec 2016
Posts: 182
Received Thanks: 82
|
Quote:
Originally Posted by InkDevil
I only answered on your question how math.random works to select a random position.
And I also said
respawn_rare_mob won't call math.random again when the monster is respawning. just when server is starting and "registering" the respawner.
If you want to make it random automatically without ScheduledCommand, take a look into random respawn script.
*Hint is given* 
|
Ok thanks
|
|
|
All times are GMT +1. The time now is 19:34.
|
|