
Posts
2,789
Respect
230Add +1
Forum Rank
King of the Zombies
Primary Group
Community Daedra
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!
#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
main()
{
level thread wonder_init();
level thread wonder_trig_think();
}
add_wonder_perk( bottle_name, hint, weight)
{
PrecacheItem( bottle_name );
PrecacheString( hint );
if( !IsDefined( bottle_name ) )
{
level.bottle_name = [];
}
level.bottle_name[bottle_name.size] = bottle_name;
if( !isDefined( weight ) )
{
level.weapon_weighting_funcs[weapon_name] = maps\_zombiemode_weapons::default_weighting_func;
}
else
{
level.weapon_weighting_funcs[weapon_name] = weighting_func;
}
}
wonder_init()
{
flag_init("moving_wonder_enabled");
flag_init("moving_wonder_now");
level.chest_index = 0;
level.wonder = getEntarray("wonder_org", "targetname");
if (level.wonder.size > 1)
{
flag_set("moving_wonder_enabled");
while ( 1 )
{
level.wonder_random = array_randomize(level.wonder);
if(isdefined(level.wonder.script_noteworthy == "start_station") )
{
break;
}
level.chest_index++;
anchor = GetEnt(level.wonder[level.wonder_index].target, "targetname");
anchorTarget = GetEnt(anchor.target, "targetname");
level.wonder_light = Spawn( "script_model", anchorTarget.origin );
level.wonder_light.angles = anchorTarget.angles + (-90, 0, 0);
level.wonder_light SetModel( "tag_origin" );
playfxontag(level._effect["lght_marker"], level.wonder_light, "tag_origin");
}
//determine wonder starting location at random or normal
init_wonder_start_location();
}
array_thread( level.wonder, ::wonder_trig_think );
}
init_wonder_start_location()
{
for( i = 0; i < level.chests.size; i++ )
{
if( isdefined(level.wonder[0].script_noteworthy == "start_station") )
{
if( i == 0 )
{
level.wonder_trigs[i].is_available = 1;
}
else
{
level.wonder_trigs[i].is_available = 0;
}
}
else
{
level.wonder_index = i;
}
}
}
wonder_trig_think()
{
level.wonder_trigs = getEntarray("wonder_trig", "targetname");
flag_wait( "electricity_on" );
while(1)
{
if(isdefined(wonder_trigs.zombie_cost) )
{
zombie_cost = wonder_trigs.zombie_cost;
}
else
{
zombie_cost = 2000;
}
level.wonder_trigs sethintstring("Press F to buy a random perk[cost: +zombie_cost]");
players = get_players();
if(players.score >= zombie_cost)
{
maps\_zombiemode_score::minus_to_player_score( who.score );
begin_wonder_effect();
}
}
}
begin_wonder_affect()
{
model = spawn( "script_model", level.wonder.origin );
model.angles = self.angles +( 0, 90, 0 );
floatHeight = 40;
player = get_players();
modelname = undefined;
rand = undefined;
number_cycles = 40;
for( i = 0; i < number_cycles; i++ )
{
if( i < 20 )
{
wait( 0.05 );
}
else if( i < 30 )
{
wait( 0.1 );
}
else if( i < 35 )
{
wait( 0.2 );
}
else if( i < 38 )
{
wait( 0.3 );
}
if( i+1 < number_cycles )
{
rand = wonder_ChooseRandomWeapon( player );
}
else
{
rand = wonder_ChooseRandomWeapon( player );
}
modelname = GetWeaponModel( rand );
model setmodel( modelname );
}
self.perk_string = rand; // here's where the org get it's weapon type for the give function
// random change of getting the joker that moves the wonderfizz
random = Randomint(100);
if( !isdefined( level.chest_min_move_usage ) )
{
level.chest_min_move_usage = 4;
}
if(level.chest_accessed < level.chest_min_move_usage)
{
// PI_CHANGE_BEGIN - JMA - RandomInt(100) can return a number between 0-99. If it's zero and chance_of_joker is zero
// we can possibly have a teddy bear one after another.
chance_of_joker = -1;
// PI_CHANGE_END
}
else
{
chance_of_joker = level.chest_accessed + 20;
// make sure teddy bear appears on the 8th pull if it hasn't moved from the initial spot
if( (!isDefined(level.magic_box_first_move) || level.magic_box_first_move == false ) && level.chest_accessed >= 8)
{
chance_of_joker = 100;
}
// pulls 4 thru 8, there is a 15% chance of getting the teddy bear
// NOTE: this happens in all cases
if( level.chest_accessed >= 4 && level.chest_accessed < 8 )
{
if( random < 15 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
// after the first magic box move the teddy bear percentages changes
if( isDefined(level.magic_box_first_move) && level.magic_box_first_move == true )
{
// between pulls 8 thru 12, the teddy bear percent is 30%
if( level.chest_accessed >= 8 && level.chest_accessed < 13 )
{
if( random < 30 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
// after 12th pull, the teddy bear percent is 50%
if( level.chest_accessed >= 13 )
{
if( random < 50 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
}
}
if (random <= chance_of_joker)
{
model SetModel("zombie_teddybear");
//wait(1);
model.angles = self.angles;
wait 1;
flag_set("moving_wonder_now");
self notify( "move_imminent" );
level.chest_accessed = 0;
player maps\_zombiemode_score::add_to_player_score( 2000 );
//allow power weapon to be accessed.
level.wonder_moved = true;
}
self notify( "randomization_done" );
if (flag("moving_chest_now") )
{
wait .5; // we need a wait here before this notify
level notify("weapon_fly_away_start");
wait 2;
model MoveZ(500, 4, 3);
model waittill("movedone");
model delete();
self notify( "box_moving" );
level notify("weapon_fly_away_end");
}
level.wonder_moved = false;
model thread timer_til_despawn(floatHeight);
self waittill( "weapon_grabbed" );
if( !level.wonder.timedOut )
{
model Delete();
}
}
}
wonder_give_perk( perk_string )
{
self waittill("weapon_grabbed");
current_weapon = undefined;
players = get_players();
if(players !hasperk(perk_string) )
{
continue;
}
perk = undefined;
switch(perk_string)
{
case "zombie_perk_bottle_jugg":
perk = "specialty_armorvest";
break;
case "":
//empty case
break;
}
gun = player perk_give_bottle_begin( perk );
player.is_drinking = 1;
player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
// restore player controls and movement
player perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
player SetPerk( perk );
player thread perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);
earthquake (0.4, 0.2, self.origin, 100);
players takeweapon("perk_string");
if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
}
}
treasure_chest_ChooseRandomWeapon( player )
{
keys = GetArrayKeys( level.bottle_name );
// Filter out any perks the player already has
filtered = [];
for( i = 0; i < keys.size; i++ )
{
if( IsDefined( keys[i] ) )
{
continue;
}
filtered[filtered.size] = keys[i];
}
return filtered[RandomInt( filtered.size )];
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has released one or more maps to the UGX-Mods community. |
does this have fx with it? i just make a new gsc for this to?

![]() | |
![]() | |
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
You should be able to catch your own syntax errors by now. WaW gives you the line location of the error and with a basic knowledge of syntax and some critical thinking you should be able to identify the problem without 5 extra sets of eyes on the forum.
Use a program with syntax highlighting such as Notepad++, Sublime Text 2, or UltraEdit.

![]() | |
![]() | |
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
Normally i do, but with this function being so long i had a hard time figuring out what was wrong. Figured it out now but i still have another syntax error and Notepad++ isn't helping at finding it anymore than normal Notepad.
