# Unused general macros that we want to preserve in case they become # useful again. # # This macro isn't actually used in the scenario "The Scepter of Fire" # because of the random location issue. We're keeping it here for # posterity for the time being. # #define OBJ_SCEPTER_FIRE X Y ID {PLACE_IMAGE items/sceptre-of-fire.png ({X}) ({Y})} [event] name=moveto first_time_only=no [filter] side=1 x={X} y={Y} [/filter] [object] id={ID} name= _ "Scepter of Fire" image=items/sceptre-of-fire.png duration=forever description= _ "This ancient Scepter was forged by the Dwarves. A symbol of the kingship of Wesnoth, the Scepter has the power to shoot fireballs at enemies of the bearer!" cannot_use_message= _ "This is the Scepter of Fire. Only a true successor to the throne can possibly dare to take this!" [filter] type=Princess,Battle Princess,Commander,Lord x,y={X},{Y} [/filter] [then] [removeitem] x,y={X},{Y} [/removeitem] [/then] [effect] apply_to=variation name=scepter [/effect] [/object] [/event] #enddef # # Originally from UtBS -- it now has a random-placement macro that # is probably better than this. # #!***Macro to random place unit within area*** #define RANDOM_PLACEMENT X Y RADIUS_NUMBER UNIT_WML [store_locations] x,y={X},{Y} radius={RADIUS_NUMBER} variable=random_placement_locations [/store_locations] {VARIABLE_OP random_string format "0..$random_placement_locations.length"} {RANDOM $random_string} {VARIABLE_OP random_placement_x format "$random_placement_locations[$random].x"} {VARIABLE_OP random_placement_y format "$random_placement_locations[$random].y"} {CLEAR_VARIABLE random_placement_locations} {UNIT_WML} [+unit] x,y=$random_placement_x,$random_placement_y [/unit] #enddef # # This was originally from Dark Forecast # #define RANDOM_SPAWN_ON_TURN TURN SIDE GOLD MAX_NUMBER [event] name=new turn first_time_only=no {VARIABLE trigger_turn $timed_spawn[$trigger_index].turn} [if] [variable] name=turn_number numerical_equals=$trigger_turn [/variable] [then] {VARIABLE size $main_group} {RANDOMIZE $size} {VARIABLE group_id $random} {VARIABLE size $main_spawns[$group_id].spawn_number} {VARIABLE gold $timed_spawn[$trigger_index].gold} {VARIABLE max_units $timed_spawn[$trigger_index].units} [while] [variable] name=gold greater_than=0 [/variable] [variable] name=max_units greater_than=0 [/variable] [do] {RANDOMIZE $size} [if] [variable] name=random greater_than=0 [/variable] [then] {VARIABLE type $main_spawns[$group_id].spawn_type[$random].type} {SPAWN_UNIT {SIDE} $type $random 1 $max_units} [/then] [else] # fallback for invalid/cleared spawn groups {VARIABLE gold 0} [/else] [/if] [/do] [/while] {ADJUST_UNIT_LEVEL {SIDE} 1} {ADJUST_UNIT_LEVEL {SIDE} 2} {ADJUST_UNIT_LEVEL {SIDE} 3} # spend remaining gold #[while] # {VARIABLE spawn_x $main_spawns[$group_id].x} # {VARIABLE spawn_y $main_spawns[$group_id].y} # {PLACE_SPAWN_GROUP $spawn_x $spawn_y} # {REMOVE_SPAWN_GROUP $group_id} # {VARIABLE_OP trigger_index add 1} [/then] [/if] [/event] #enddef