hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 15:43



Jelenlévő felhasználók

Jelenleg 377 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 375 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Frost Nade
HozzászólásElküldve:2012.06.07. 16:42 
Offline
Tud valamit

Csatlakozott:2011.08.28. 08:19
Hozzászólások:103
Sziasztok. Az lenne a hiba hogy beállítottam a Frost Nade-t Smokegrenade helyére eldobtam és nem működött. Eljátszottam az összes gránáttal ezt és egyiknél se volt jó. Itt a SMA ha valaki tudná mi a baja
Kód:
  1.     /*-------------------

  2.       INCLUDES AND DEFINES

  3.     --------------------*/

  4.  

  5.     #include <amxmodx>

  6.     #include <fun>

  7.     #include <engine>

  8.     #include <fakemeta>

  9.     #include <cstrike>

  10.     #include <zombieplague>

  11.  

  12.     new hasFrostNade[33];

  13.     new isChilled[33];

  14.     new isFrozen[33];

  15.  

  16.     new novaDisplay[33];

  17.     new Float:oldSpeed[33];

  18.  

  19.     new glassGibs;

  20.     new trailSpr;

  21.     new smokeSpr;

  22.     new exploSpr;

  23.  

  24.     #define FROST_RADIUS   240.0

  25.     #define FROST_R   0

  26.     #define FROST_G   206

  27.     #define FROST_B   209

  28.  

  29.     #define TASK_REMOVE_CHILL   200

  30.     #define TASK_REMOVE_FREEZE   250

  31.  

  32.     /*----------------

  33.       LOADING FUNCTIONS

  34.     -----------------*/

  35.  

  36.     // 3, 2, 1: blastoff!

  37.     public plugin_init()

  38.     {

  39.        register_plugin("FrostNades","0.12b","Avalanche");

  40.  

  41.        register_cvar("fn_on","1");

  42.        register_cvar("fn_hitself","1");

  43.        register_cvar("fn_los","0");

  44.  

  45.        register_cvar("fn_maxdamage","20.0");

  46.        register_cvar("fn_mindamage","1.0");

  47.  

  48.        register_cvar("fn_override","1");

  49.        register_cvar("fn_price","300");

  50.  

  51.        register_cvar("fn_chill_maxchance","100");

  52.        register_cvar("fn_chill_minchance","100");

  53.        register_cvar("fn_chill_duration","10");

  54.        register_cvar("fn_chill_speed","60");

  55.  

  56.        register_cvar("fn_freeze_maxchance","100");

  57.        register_cvar("fn_freeze_minchance","40");

  58.        register_cvar("fn_freeze_duration","3");

  59.  

  60.        register_clcmd("say /fn","buy_frostnade",-1);

  61.        register_clcmd("say_team /fn","buy_frostnade",-1);

  62.        register_clcmd("say /frostnade","buy_frostnade",-1);

  63.        register_clcmd("say_team /frostnade","buy_frostnade",-1);

  64.  

  65.        register_event("DeathMsg","event_deathmsg","a");

  66.        register_event("CurWeapon","event_curweapon","b","1=1");

  67.        register_forward(FM_SetModel,"fw_setmodel");

  68.        register_think("grenade","think_grenade");

  69.  

  70.        register_logevent("event_roundend",2,"0=World triggered","1=Round_End");

  71.     }

  72.  

  73.     // get in the cache and be quiet!!

  74.     public plugin_precache() {

  75.        precache_model("models/v_smokegrenade.mdl");

  76.        glassGibs = precache_model("models/glassgibs.mdl");

  77.  

  78.        precache_sound("warcraft3/frostnova.wav"); // grenade explodes

  79.        precache_sound("warcraft3/impalehit.wav"); // player is frozen

  80.        precache_sound("warcraft3/impalelaunch1.wav"); // frozen wears off

  81.        precache_sound("player/pl_duct2.wav"); // player is chilled

  82.  

  83.        trailSpr = precache_model("sprites/laserbeam.spr");

  84.        smokeSpr = precache_model("sprites/steam1.spr");

  85.        exploSpr = precache_model("sprites/shockwave.spr");

  86.     }

  87.  

  88.     /*------------

  89.       HOOK HANDLERS

  90.     -------------*/

  91.  

  92.     // player wants to buy a grenade

  93.     public buy_frostnade(id)

  94.     {

  95.        if(!get_cvar_num("fn_on"))

  96.           return PLUGIN_CONTINUE;

  97.  

  98.        // can't buy while dead

  99.        if(!is_user_alive(id))

  100.           return PLUGIN_HANDLED;

  101.  

  102.        // no custom buy needed

  103.        if(get_cvar_num("fn_override"))

  104.           return PLUGIN_HANDLED;

  105.  

  106.        // not in a buyzone

  107.        if(!cs_get_user_buyzone(id))

  108.           return PLUGIN_HANDLED;

  109.  

  110.        // not enough money

  111.        new money = cs_get_user_money(id);

  112.  

  113.        if(money < get_cvar_num("fn_price"))

  114.        {

  115.           client_print(id,print_center,"#Not_Enough_Money");

  116.           return PLUGIN_HANDLED;

  117.        }

  118.  

  119.        // already have a frost grenade

  120.        if(hasFrostNade[id])

  121.        {

  122.           client_print(id,print_center,"#Cstrike_Already_Own_Weapon");

  123.           return PLUGIN_HANDLED;

  124.        }

  125.  

  126.        // already have a smoke grenade

  127.        new weapons[32], num, i;

  128.        get_user_weapons(id,weapons,num);

  129.  

  130.        for(i=0;i<num;i++)

  131.        {

  132.           if(weapons[i] == CSW_FLASHBANG)

  133.           {

  134.              client_print(id,print_center,"You already own a smoke grenade.");

  135.              return PLUGIN_HANDLED;

  136.           }

  137.        }

  138.  

  139.        // gimme gimme

  140.        hasFrostNade[id] = 1;

  141.        give_item(id,"weapon_flashbang");

  142.        cs_set_user_money(id,money - get_cvar_num("fn_price"));

  143.  

  144.        // display icon

  145.        message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);

  146.        write_byte(1); // status (0=hide, 1=show, 2=flash)

  147.        write_string("dmg_cold"); // sprite name

  148.        write_byte(FROST_R); // red

  149.        write_byte(FROST_G); // green

  150.        write_byte(FROST_B); // blue

  151.        message_end();

  152.  

  153.        return PLUGIN_HANDLED;

  154.     }

  155.  

  156.     // prethinking

  157.     public client_PreThink(id)

  158.     {

  159.        if(!get_cvar_num("fn_on"))

  160.           return;

  161.  

  162.        // if they are frozen, make sure they don't move at all

  163.        if(isFrozen[id])

  164.        {

  165.           // stop motion

  166.           entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0});

  167.  

  168.           new button = get_user_button(id), oldbuttons = entity_get_int(id,EV_INT_oldbuttons);

  169.           new flags = entity_get_int(id,EV_INT_flags);

  170.  

  171.           // if are on the ground and about to jump, set the gravity too high to really do so

  172.           if((button & IN_JUMP) && !(oldbuttons & IN_JUMP) && (flags & FL_ONGROUND))

  173.              entity_set_float(id,EV_FL_gravity,999999.9); // I CAN'T STAND THE PRESSURE

  174.  

  175.           // otherwise, set the gravity so low that they don't fall

  176.           else

  177.              entity_set_float(id,EV_FL_gravity,0.000001); // 0.0 doesn't work

  178.        }

  179.     }

  180.  

  181.     // someone dies

  182.     public event_deathmsg()

  183.     {

  184.        if(!get_cvar_num("fn_on"))

  185.           return;

  186.  

  187.        new id = read_data(2);

  188.  

  189.        if(hasFrostNade[id])

  190.        {

  191.           hasFrostNade[id] = 0;

  192.           message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);

  193.           write_byte(0); // status (0=hide, 1=show, 2=flash)

  194.           write_string("dmg_cold"); // sprite name

  195.           write_byte(FROST_R); // red

  196.           write_byte(FROST_G); // green

  197.           write_byte(FROST_B); // blue

  198.           message_end();

  199.        }

  200.  

  201.        if(isChilled[id])

  202.           remove_chill(TASK_REMOVE_CHILL+id);

  203.  

  204.        if(isFrozen[id])

  205.           remove_freeze(TASK_REMOVE_FREEZE+id);

  206.     }

  207.  

  208.     // a player changes weapons

  209.     public event_curweapon(id)

  210.     {

  211.        if(!get_cvar_num("fn_on"))

  212.           return;

  213.  

  214.        // flash icon if frost grenade is out

  215.        if(hasFrostNade[id] && read_data(2) == CSW_FLASHBANG)

  216.        {

  217.           message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);

  218.           write_byte(2); // status (0=hide, 1=show, 2=flash)

  219.           write_string("dmg_cold"); // sprite name

  220.           write_byte(FROST_R); // red

  221.           write_byte(FROST_G); // green

  222.           write_byte(FROST_B); // blue

  223.           message_end();

  224.        }

  225.        else if(hasFrostNade[id])

  226.        {

  227.           message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);

  228.           write_byte(1); // status (0=hide, 1=show, 2=flash)

  229.           write_string("dmg_cold"); // sprite name

  230.           write_byte(FROST_R); // red

  231.           write_byte(FROST_G); // green

  232.           write_byte(FROST_B); // blue

  233.           message_end();

  234.        }

  235.  

  236.        if(isChilled[id])

  237.           chill_player(id);

  238.  

  239.        if(isFrozen[id])

  240.           freeze_player(id);

  241.     }

  242.  

  243.     // when a model is set

  244.     public fw_setmodel(ent,model[])

  245.     {

  246.        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))

  247.           return FMRES_IGNORED;

  248.  

  249.        // not a smoke grenade

  250.        if(!equali(model,"models/w_flasbang.mdl"))

  251.           return FMRES_IGNORED;

  252.  

  253.        // not yet thrown

  254.        if(entity_get_float(ent,EV_FL_gravity) == 0.0)

  255.           return FMRES_IGNORED;

  256.  

  257.        new owner = entity_get_edict(ent,EV_ENT_owner);

  258.  

  259.        // check to see if this isn't a frost grenade

  260.        if(!get_cvar_num("fn_override") && !hasFrostNade[owner])

  261.           return FMRES_IGNORED;

  262.  

  263.        // store team in the grenade

  264.        entity_set_int(ent,EV_INT_team,get_user_team(owner));

  265.  

  266.        // hide icon

  267.        if(hasFrostNade[owner])

  268.        {

  269.           hasFrostNade[owner] = 0;

  270.           message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},owner);

  271.           write_byte(0); // status (0=hide, 1=show, 2=flash)

  272.           write_string("dmg_cold"); // sprite name

  273.           write_byte(FROST_R); // red

  274.           write_byte(FROST_G); // green

  275.           write_byte(FROST_B); // blue

  276.           message_end();

  277.        }

  278.  

  279.        // give it a blue glow and a blue trail

  280.        set_rendering(ent,kRenderFxGlowShell,FROST_R,FROST_G,FROST_B);

  281.        set_beamfollow(ent,10,10,FROST_R,FROST_G,FROST_B,100);

  282.  

  283.        // hack? flag to remember to track this grenade's think

  284.        entity_set_int(ent,EV_INT_bInDuck,1);

  285.  

  286.        // track for when it will explode

  287.        set_task(1.6,"grenade_explode",ent);

  288.  

  289.        return FMRES_IGNORED;

  290.     }

  291.  

  292.     // think, grenade. think, damnit!

  293.     public think_grenade(ent)

  294.     {

  295.        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))

  296.           return PLUGIN_CONTINUE;

  297.  

  298.        // hack? not a smoke grenade, or at least not a popular one

  299.        if(!entity_get_int(ent,EV_INT_bInDuck))

  300.           return PLUGIN_CONTINUE;

  301.  

  302.        // stop it from exploding

  303.        return PLUGIN_HANDLED;

  304.     }

  305.  

  306.     // the round ends

  307.     public event_roundend()

  308.     {

  309.        new i;

  310.        for(i=1;i<=32;i++)

  311.        {

  312.           if(isChilled[i])

  313.              remove_chill(TASK_REMOVE_CHILL+i);

  314.  

  315.           if(isFrozen[i])

  316.              remove_freeze(TASK_REMOVE_FREEZE+i);

  317.        }

  318.     }

  319.  

  320.     /*-------------------

  321.       OTHER MAIN FUNCTIONS

  322.     --------------------*/

  323.  

  324.     // and boom goes the dynamite

  325.     public grenade_explode(ent)

  326.     {

  327.        if(get_cvar_num("fn_on") < 1 || !is_valid_ent(ent))

  328.           return;

  329.  

  330.        // make the smoke

  331.        new origin[3], Float:originF[3];

  332.        entity_get_vector(ent,EV_VEC_origin,originF);

  333.        FVecIVec(originF,origin);

  334.  

  335.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  336.        write_byte(5); // TE_SMOKE

  337.        write_coord(origin[0]); // x

  338.        write_coord(origin[1]); // y

  339.        write_coord(origin[2]); // z

  340.        write_short(smokeSpr); // sprite

  341.        write_byte(random_num(35,45)); // scale

  342.        write_byte(5); // framerate

  343.        message_end();

  344.  

  345.        // debug

  346.        //show_xyz(origin,floatround(FROST_RADIUS));

  347.  

  348.        // explosion

  349.        create_blast(origin);

  350.        emit_sound(ent,CHAN_WEAPON,"warcraft3/frostnova.wav",1.0,ATTN_NORM,0,PITCH_NORM);

  351.  

  352.        // get grenade's owner

  353.        new owner = entity_get_edict(ent,EV_ENT_owner);

  354.  

  355.        // get grenades team

  356.        new nadeTeam = entity_get_int(ent,EV_INT_team);

  357.  

  358.        // collisions

  359.        new player;

  360.        while((player = find_ent_in_sphere(player,originF,FROST_RADIUS)) != 0)

  361.        {

  362.           // not a player, or a dead one

  363.           if(!is_user_alive(player))

  364.              continue;

  365.  

  366.           // don't hit teammates if friendlyfire is off, but don't count self as teammate

  367.           if((!get_cvar_num("mp_friendlyfire") && nadeTeam == get_user_team(player)) && owner != player)

  368.              continue;

  369.  

  370.           // don't hit self if the cvar is set

  371.           if(owner == player && !get_cvar_num("fn_hitself"))

  372.              continue;

  373.  

  374.           // if user was frozen this check

  375.           new wasFrozen;

  376.  

  377.           // get this player's origin for calculations

  378.           new Float:playerOrigin[3];

  379.           entity_get_vector(player,EV_VEC_origin,playerOrigin);

  380.  

  381.           // check for line of sight

  382.           if(get_cvar_num("fn_los"))

  383.           {

  384.              new Float:endPos[3];

  385.              trace_line(ent,originF,playerOrigin,endPos);

  386.  

  387.              // no line of sight (end point not at player's origin)

  388.              if(endPos[0] != playerOrigin[0] && endPos[1] != playerOrigin[1] && endPos[2] != playerOrigin[2])

  389.                 continue;

  390.           }

  391.  

  392.           // calculate our odds

  393.           new Float:chillChance = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_chill_maxchance"),get_cvar_float("fn_chill_minchance"));

  394.           new Float:freezeChance = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_freeze_maxchance"),get_cvar_float("fn_freeze_minchance"));

  395.  

  396.           // deal damage

  397.           if(get_cvar_float("fn_maxdamage") > 0.0)

  398.           {

  399.              new Float:damage = radius_calucation(playerOrigin,originF,FROST_RADIUS,get_cvar_float("fn_maxdamage"),get_cvar_float("fn_mindamage"));

  400.  

  401.              // half damage for friendlyfire

  402.              if(nadeTeam == get_user_team(player))

  403.                 damage *= 0.5;

  404.  

  405.              // see if this will kill player

  406.              if(floatround(entity_get_float(player,EV_FL_health)) - damage <= 0)

  407.              {

  408.                 user_silentkill(player);

  409.                 make_deathmsg(owner,player,0,"frostgrenade");

  410.  

  411.                 // update score

  412.                 if(nadeTeam == get_user_team(player))

  413.                 {

  414.                    set_user_frags(owner,get_user_frags(owner)-1);

  415.  

  416.                    if(get_cvar_num("mp_tkpunish"))

  417.                       cs_set_user_tked(owner,1,0);

  418.                 }

  419.                 else

  420.                    set_user_frags(owner,get_user_frags(owner)+1);

  421.  

  422.                 // update scoreboard

  423.                 message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));

  424.                 write_byte(owner);

  425.                 write_short(get_user_frags(owner));

  426.                 write_short(cs_get_user_deaths(owner));

  427.                 write_short(0);

  428.                 write_short(get_user_team(owner));

  429.                 message_end();

  430.  

  431.                 message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));

  432.                 write_byte(player);

  433.                 write_short(get_user_frags(player));

  434.                 write_short(cs_get_user_deaths(player));

  435.                 write_short(0);

  436.                 write_short(get_user_team(player));

  437.                 message_end();

  438.  

  439.                 continue;

  440.              }

  441.  

  442.              fakedamage(player,"frostgrenade",damage,3);

  443.           }

  444.  

  445.           // check for freeze

  446.           if(random_num(1,100) <= floatround(freezeChance) && !isFrozen[player])

  447.           {

  448.              wasFrozen = 1;

  449.              freeze_player(player);

  450.              isFrozen[player] = 1;

  451.  

  452.              emit_sound(player,CHAN_BODY,"warcraft3/impalehit.wav",1.0,ATTN_NORM,0,PITCH_HIGH);

  453.              set_task(get_cvar_float("fn_freeze_duration"),"remove_freeze",TASK_REMOVE_FREEZE+player);

  454.  

  455.              // if they don't already have a frostnova

  456.              if(!is_valid_ent(novaDisplay[player]))

  457.              {

  458.                 // create the entity

  459.                 new nova = create_entity("info_target");

  460.  

  461.                 // give it a size

  462.                 new Float:maxs[3], Float:mins[3];

  463.                 maxs = Float:{ 8.0, 8.0, 4.0 };

  464.                 mins = Float:{ -8.0, -8.0, -4.0 };

  465.                 entity_set_size(nova,mins,maxs);

  466.  

  467.                 // random orientation

  468.                 new Float:angles[3];

  469.                 angles[1] = float(random_num(0,359));

  470.                 entity_set_vector(nova,EV_VEC_angles,angles);

  471.  

  472.                 // put it at their feet

  473.                 new Float:playerMins[3], Float:novaOrigin[3];

  474.                 entity_get_vector(player,EV_VEC_mins,playerMins);

  475.                 entity_get_vector(player,EV_VEC_origin,novaOrigin);

  476.                 novaOrigin[2] += playerMins[2];

  477.                 entity_set_vector(nova,EV_VEC_origin,novaOrigin);

  478.  

  479.                 // mess with the model

  480.                 entity_set_model(nova,"models/frostnova.mdl");

  481.                 entity_set_float(nova,EV_FL_animtime,1.0)

  482.                 entity_set_float(nova,EV_FL_framerate,1.0)

  483.                 entity_set_int(nova,EV_INT_sequence,0);

  484.                 set_rendering(nova,kRenderFxNone,FROST_R,FROST_G,FROST_B,kRenderTransColor,100);

  485.  

  486.                 // remember this

  487.                 novaDisplay[player] = nova;

  488.              }

  489.           }

  490.  

  491.           // check for chill

  492.           if(random_num(1,100) <= floatround(chillChance) && !isChilled[player])

  493.           {

  494.              chill_player(player);

  495.              isChilled[player] = 1;

  496.  

  497.              // don't play sound if player just got frozen,

  498.              // reason being it will be overriden and I like the other sound better

  499.              if(!wasFrozen)

  500.                 emit_sound(player,CHAN_BODY,"player/pl_duct2.wav",1.0,ATTN_NORM,0,PITCH_LOW);

  501.  

  502.              set_task(get_cvar_float("fn_chill_duration"),"remove_chill",TASK_REMOVE_CHILL+player);

  503.           }

  504.        }

  505.  

  506.        // get rid of the old grenade

  507.        remove_entity(ent);

  508.     }

  509.  

  510.     // apply the effects of being chilled

  511.     public chill_player(id)

  512.     {

  513.        // don't mess with their speed if they are frozen

  514.        if(isFrozen[id])

  515.           set_user_maxspeed(id,1.0); // 0.0 doesn't work

  516.        else

  517.        {

  518.           new speed = floatround(get_user_maxspeed(id) * (get_cvar_float("fn_chill_speed") / 100.0));

  519.           set_user_maxspeed(id,float(speed));

  520.        }

  521.  

  522.        // add a blue tint to their screen

  523.        message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);

  524.        write_short(~0); // duration

  525.        write_short(~0); // hold time

  526.        write_short(0x0004); // flags: FFADE_STAYOUT, ignores the duration, stays faded out until new ScreenFade message received

  527.        write_byte(FROST_R); // red

  528.        write_byte(FROST_G); // green

  529.        write_byte(FROST_B); // blue

  530.        write_byte(100); // alpha

  531.        message_end();

  532.  

  533.        // make them glow and have a trail

  534.        set_user_rendering(id,kRenderFxGlowShell,FROST_R,FROST_G,FROST_B,kRenderNormal,1);

  535.  

  536.        // bug fix

  537.        if(!isFrozen[id])

  538.           set_beamfollow(id,30,8,FROST_R,FROST_G,FROST_B,100);

  539.     }

  540.  

  541.     // apply the effects of being frozen

  542.     public freeze_player(id)

  543.     {

  544.        new Float:speed = get_user_maxspeed(id);

  545.  

  546.        // remember their old speed for when they get unfrozen,

  547.        // but don't accidentally save their frozen speed

  548.        if(speed > 1.0 && speed != oldSpeed[id])

  549.        {

  550.           // save their unchilled speed

  551.           if(isChilled[id])

  552.           {

  553.              new speed = floatround(get_user_maxspeed(id) / (get_cvar_float("fn_chill_speed") / 100.0));

  554.              oldSpeed[id] = float(speed);

  555.           }

  556.           else

  557.              oldSpeed[id] = speed;

  558.        }

  559.  

  560.        // stop them from moving

  561.        set_user_maxspeed(id,1.0); // 0.0 doesn't work

  562.        entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0});

  563.        entity_set_float(id,EV_FL_gravity,0.000001); // 0.0 doesn't work

  564.     }

  565.  

  566.     // a player's chill runs out

  567.     public remove_chill(taskid)

  568.     {

  569.        remove_task(taskid);

  570.        new id = taskid - TASK_REMOVE_CHILL;

  571.  

  572.        // no longer chilled

  573.        if(!isChilled[id])

  574.           return;

  575.  

  576.        isChilled[id] = 0;

  577.  

  578.        // only apply effects to this player if they are still connected

  579.        if(is_user_connected(id))

  580.        {

  581.           // clear screen fade

  582.           message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);

  583.           write_short(0); // duration

  584.           write_short(0); // hold time

  585.           write_short(0); // flags

  586.           write_byte(0); // red

  587.           write_byte(0); // green

  588.           write_byte(0); // blue

  589.           write_byte(0); // alpha

  590.           message_end();

  591.  

  592.           // restore speed and remove glow

  593.           new speed = floatround(get_user_maxspeed(id) / (get_cvar_float("fn_chill_speed") / 100.0));

  594.           set_user_maxspeed(id,float(speed));

  595.           set_user_rendering(id);

  596.  

  597.           // kill their trail

  598.           message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  599.           write_byte(99); // TE_KILLBEAM

  600.           write_short(id);

  601.           message_end();

  602.        }

  603.     }

  604.  

  605.     // a player's freeze runs out

  606.     public remove_freeze(taskid)

  607.     {

  608.        remove_task(taskid);

  609.        new id = taskid - TASK_REMOVE_FREEZE;

  610.  

  611.        // no longer frozen

  612.        if(!isFrozen[id])

  613.           return;

  614.  

  615.        // if nothing happened to the model

  616.        if(is_valid_ent(novaDisplay[id]))

  617.        {

  618.           // get origin of their frost nova

  619.           new origin[3], Float:originF[3];

  620.           entity_get_vector(novaDisplay[id],EV_VEC_origin,originF);

  621.           FVecIVec(originF,origin);

  622.  

  623.           // add some tracers

  624.           message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  625.           write_byte(14); // TE_IMPLOSION

  626.           write_coord(origin[0]); // x

  627.           write_coord(origin[1]); // y

  628.           write_coord(origin[2] + 8); // z

  629.           write_byte(64); // radius

  630.           write_byte(10); // count

  631.           write_byte(3); // duration

  632.           message_end();

  633.  

  634.           // add some sparks

  635.           message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  636.           write_byte(9); // TE_SPARKS

  637.           write_coord(origin[0]); // x

  638.           write_coord(origin[1]); // y

  639.           write_coord(origin[2]); // z

  640.           message_end();

  641.  

  642.           // add the shatter

  643.           message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  644.           write_byte(108); // TE_BREAKMODEL

  645.           write_coord(origin[0]); // x

  646.           write_coord(origin[1]); // y

  647.           write_coord(origin[2] + 24); // z

  648.           write_coord(16); // size x

  649.           write_coord(16); // size y

  650.           write_coord(16); // size z

  651.           write_coord(random_num(-50,50)); // velocity x

  652.           write_coord(random_num(-50,50)); // velocity y

  653.           write_coord(25); // velocity z

  654.           write_byte(10); // random velocity

  655.           write_short(glassGibs); // model

  656.           write_byte(10); // count

  657.           write_byte(25); // life

  658.           write_byte(0x01); // flags: BREAK_GLASS

  659.           message_end();

  660.  

  661.           // play a sound and remove the model

  662.           emit_sound(novaDisplay[id],CHAN_BODY,"warcraft3/impalelaunch1.wav",1.0,ATTN_NORM,0,PITCH_LOW);

  663.           remove_entity(novaDisplay[id]);

  664.        }

  665.  

  666.        isFrozen[id] = 0;

  667.        novaDisplay[id] = 0;

  668.  

  669.        // only apply effects to this player if they are still connected

  670.        if(is_user_connected(id))

  671.        {

  672.           // restore gravity

  673.           entity_set_float(id,EV_FL_gravity,1.0);

  674.  

  675.           // if they are still chilled, set the speed rightly so. otherwise, restore it to complete regular.

  676.           if(isChilled[id])

  677.           {

  678.              set_beamfollow(id,30,8,FROST_R,FROST_G,FROST_B,100); // bug fix

  679.  

  680.              new speed = floatround(oldSpeed[id] * (get_cvar_float("fn_chill_speed") / 100.0));

  681.              set_user_maxspeed(id,float(speed));

  682.           }

  683.           else

  684.              set_user_maxspeed(id,oldSpeed[id]);

  685.        }

  686.  

  687.        oldSpeed[id] = 0.0;

  688.     }

  689.  

  690.     /*----------------

  691.       UTILITY FUNCTIONS

  692.     -----------------*/

  693.  

  694.     // my own radius calculations...

  695.     //

  696.     // 1. figure out how far a player is from a center point

  697.     // 2. figure the percentage this distance is of the overall radius

  698.     // 3. find a value between maxVal and minVal based on this percentage

  699.     //

  700.     // example: origin1 is 96 units away from origin2, and radius is 240.

  701.     // this player is then 60% towards the center from the edge of the sphere.

  702.     // let us say maxVal is 100.0 and minVal is 25.0. 60% progression from minimum

  703.     // to maximum becomes 70.0. tada!

  704.     public Float:radius_calucation(Float:origin1[3],Float:origin2[3],Float:radius,Float:maxVal,Float:minVal)

  705.     {

  706.        if(maxVal <= 0.0)

  707.           return 0.0;

  708.  

  709.        if(minVal >= maxVal)

  710.           return minVal;

  711.  

  712.        new Float:percent;

  713.  

  714.        // figure out how far away the points are

  715.        new Float:distance = vector_distance(origin1,origin2);

  716.  

  717.        // if we are close enough, assume we are at the center

  718.        if(distance < 40.0)

  719.           return maxVal;

  720.  

  721.        // otherwise, calculate the distance range

  722.        else

  723.           percent = 1.0 - (distance / radius);

  724.  

  725.        // we have the technology...

  726.        return minVal + (percent * (maxVal - minVal));

  727.     }

  728.  

  729.     // displays x y z axis

  730.     public show_xyz(origin[3],radius)

  731.     {

  732.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  733.        write_byte(0); // TE_BEAMPOINTS

  734.        write_coord(origin[0]); // start x

  735.        write_coord(origin[1]); // starty

  736.        write_coord(origin[2] + 1); // start z

  737.        write_coord(origin[0] + radius); // end x

  738.        write_coord(origin[1]); // end y

  739.        write_coord(origin[2] + 1); // end z

  740.        write_short(trailSpr); // sprite

  741.        write_byte(0); // starting frame

  742.        write_byte(0); // framerate

  743.        write_byte(100); // life

  744.        write_byte(8); // line width

  745.        write_byte(0); // noise

  746.        write_byte(255); // r

  747.        write_byte(0); // g

  748.        write_byte(0); // b

  749.        write_byte(200); // brightness

  750.        write_byte(0); // scroll speed

  751.        message_end();

  752.  

  753.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  754.        write_byte(0); // TE_BEAMPOINTS

  755.        write_coord(origin[0]); // start x

  756.        write_coord(origin[1]); // starty

  757.        write_coord(origin[2] + 1); // start z

  758.        write_coord(origin[0]); // end x

  759.        write_coord(origin[1] + radius); // end y

  760.        write_coord(origin[2] + 1); // end z

  761.        write_short(trailSpr); // sprite

  762.        write_byte(0); // starting frame

  763.        write_byte(0); // framerate

  764.        write_byte(100); // life

  765.        write_byte(8); // line width

  766.        write_byte(0); // noise

  767.        write_byte(0); // r

  768.        write_byte(255); // g

  769.        write_byte(0); // b

  770.        write_byte(200); // brightness

  771.        write_byte(0); // scroll speed

  772.        message_end();

  773.  

  774.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  775.        write_byte(0); // TE_BEAMPOINTS

  776.        write_coord(origin[0]); // start x

  777.        write_coord(origin[1]); // starty

  778.        write_coord(origin[2]); // start z

  779.        write_coord(origin[0]); // end x

  780.        write_coord(origin[1]); // end y

  781.        write_coord(origin[2] + radius); // end z

  782.        write_short(trailSpr); // sprite

  783.        write_byte(0); // starting frame

  784.        write_byte(0); // framerate

  785.        write_byte(100); // life

  786.        write_byte(8); // line width

  787.        write_byte(0); // noise

  788.        write_byte(0); // r

  789.        write_byte(0); // g

  790.        write_byte(255); // b

  791.        write_byte(200); // brightness

  792.        write_byte(0); // scroll speed

  793.        message_end();

  794.     }

  795.  

  796.     // give an entity a trail

  797.     public set_beamfollow(ent,life,width,r,g,b,brightness)

  798.     {

  799.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  800.        write_byte(22); // TE_BEAMFOLLOW

  801.        write_short(ent); // ball

  802.        write_short(trailSpr); // sprite

  803.        write_byte(life); // life

  804.        write_byte(width); // width

  805.        write_byte(r); // r

  806.        write_byte(g); // g

  807.        write_byte(b); // b

  808.        write_byte(brightness); // brightness

  809.        message_end();

  810.     }

  811.  

  812.     // blue blast

  813.     public create_blast(origin[3])

  814.     {

  815.        // smallest ring

  816.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  817.        write_byte(21); // TE_BEAMCYLINDER

  818.        write_coord(origin[0]); // start X

  819.        write_coord(origin[1]); // start Y

  820.        write_coord(origin[2]); // start Z

  821.        write_coord(origin[0]); // something X

  822.        write_coord(origin[1]); // something Y

  823.        write_coord(origin[2] + 385); // something Z

  824.        write_short(exploSpr); // sprite

  825.        write_byte(0); // startframe

  826.        write_byte(0); // framerate

  827.        write_byte(4); // life

  828.        write_byte(60); // width

  829.        write_byte(0); // noise

  830.        write_byte(FROST_R); // red

  831.        write_byte(FROST_G); // green

  832.        write_byte(FROST_B); // blue

  833.        write_byte(100); // brightness

  834.        write_byte(0); // speed

  835.        message_end();

  836.  

  837.        // medium ring

  838.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  839.        write_byte(21); // TE_BEAMCYLINDER

  840.        write_coord(origin[0]); // start X

  841.        write_coord(origin[1]); // start Y

  842.        write_coord(origin[2]); // start Z

  843.        write_coord(origin[0]); // something X

  844.        write_coord(origin[1]); // something Y

  845.        write_coord(origin[2] + 470); // something Z

  846.        write_short(exploSpr); // sprite

  847.        write_byte(0); // startframe

  848.        write_byte(0); // framerate

  849.        write_byte(4); // life

  850.        write_byte(60); // width

  851.        write_byte(0); // noise

  852.        write_byte(FROST_R); // red

  853.        write_byte(FROST_G); // green

  854.        write_byte(FROST_B); // blue

  855.        write_byte(100); // brightness

  856.        write_byte(0); // speed

  857.        message_end();

  858.  

  859.        // largest ring

  860.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  861.        write_byte(21); // TE_BEAMCYLINDER

  862.        write_coord(origin[0]); // start X

  863.        write_coord(origin[1]); // start Y

  864.        write_coord(origin[2]); // start Z

  865.        write_coord(origin[0]); // something X

  866.        write_coord(origin[1]); // something Y

  867.        write_coord(origin[2] + 555); // something Z

  868.        write_short(exploSpr); // sprite

  869.        write_byte(0); // startframe

  870.        write_byte(0); // framerate

  871.        write_byte(4); // life

  872.        write_byte(60); // width

  873.        write_byte(0); // noise

  874.        write_byte(FROST_R); // red

  875.        write_byte(FROST_G); // green

  876.        write_byte(FROST_B); // blue

  877.        write_byte(100); // brightness

  878.        write_byte(0); // speed

  879.        message_end();

  880.  

  881.        // light effect

  882.        message_begin(MSG_BROADCAST,SVC_TEMPENTITY);

  883.        write_byte(27); // TE_DLIGHT

  884.        write_coord(origin[0]); // x

  885.        write_coord(origin[1]); // y

  886.        write_coord(origin[2]); // z

  887.        write_byte(floatround(FROST_RADIUS/5.0)); // radius

  888.        write_byte(FROST_R); // r

  889.        write_byte(FROST_G); // g

  890.        write_byte(FROST_B); // b

  891.        write_byte(8); // life

  892.        write_byte(60); // decay rate

  893.        message_end();

  894.     }

_________________
Magyar Biohazard szervert keresek, ha kell segítek is.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Frost Nade
HozzászólásElküldve:2012.08.20. 23:36 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Váltottál utánna mapot/szeró resi volt?


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Frost Nade
HozzászólásElküldve:2012.08.23. 15:01 
Offline
Beavatott

Csatlakozott:2012.07.04. 13:41
Hozzászólások:66
Megköszönt másnak: 9 alkalommal
Még annó az én zombie szerómon is így volt megcsinálva és működött :)
Nyomj egy szerver resit :D

_________________
Plugin készítést vállalok! -> PM


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 5 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole