Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // All Out War 2 Class purchase scripts
- // Credit to VoltlocK for originally creating AOW2
- // With modifications by Eruanna, Dusk and the Omega Team
- // You may use portions of this script in your project as long as you give credit where credit is
- // due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!
- /*============================================================================
- *
- * C L A S S E S
- *
- * ============================================================================
- *
- * List of classes and their definitions. Pass an
- * identifier to PurchaseClass() / SetClass() to
- * set a class to the player.
- *
- * Identifier constant chain MUST be in the same
- * order as the actual class array.
- *
- * The class array is where the classes are actually
- * defined in. Changes in here result in changes to class
- * specs. New classes must use existing format and template.
- *
- * Array keys:
- * row 1:
- * - display name
- * - price (0 for free)
- * - speed (fixed point)
- * - dependency (constant)
- *
- * row 2:
- * - armor grade (-1 - 5)
- * - armor modifier
- *
- * row 3:
- * - frag grenades
- * - timed C4 count
- * - enhanced timed C4 (true/false)
- * - flags
- * - CF_NOPISTOL (no handgun)
- * - CF_HARVESTER (is a harvester)
- * - CF_SNIPER (has powered-up sniper)
- * - CF_STEALTH (is a stealth class)
- * - CF_WARNING (warning printed on purchase)
- * - CF_NOMECHS (cannot use mechs)
- * - CF_MEDIC (gets medic regeneration)
- * - CF_TIMECOP (counts as a timecop for limit)
- * - CF_SUPPORT (counts as a support class)
- *
- * row 4:
- * - item 1 | primary weapon
- * - item 2 |
- * - item 3 | See a_items.acs for
- * - item 4 | item definitons
- * - item 5 |
- * - item 6 |
- */
- int Classes[MAX_CLASSES][MAX_CLASSKEYS] = {
- /* {
- "Name of class", cost, speed, dependency,
- armor, armor_mod,
- frags, c4, enhanced, flags,
- item0, item1, item2, item3, item4, item5
- } */
- {
- "Gunman", 0, 1.0, DEP_NONE,
- 0, ARMOD_NOCHANGE,
- 1, 1, false, 0,
- ITEM_SMG, 0, 0, 0, 0, 0
- }, {
- "Engineer", 0, 0.8, DEP_NONE,
- 0, ARMOD_NOCHANGE,
- 1, 1, true, 0,
- ITEM_REPAIR, 0, 0, 0, 0, 0
- }, {
- "Minigunner", 400, 0.7, DEP_NONE,
- 1, ARMOD_NOCHANGE,
- 2, 1, false, 0,
- ITEM_GATLING, 0, 0, 0, 0, 0
- }, {
- "Technician", 200, 0.8, DEP_NONE,
- 1, ARMOD_NOCHANGE,
- 2, 2, true, CF_SUPPORT,
- ITEM_ADVREPAIR, ITEM_SMG, ITEM_MINE_X4, 0, 0, 0
- }, {
- "Flamer", 450, 0.7, DEP_BARRACKS,
- 1, ARMOD_FIRE,
- 2, 1, false, 0,
- ITEM_FLAMER, 0, 0, 0, 0, 0
- }, {
- "Rifleman", 200, 0.9, DEP_NONE,
- 1, ARMOD_NOCHANGE,
- 2, 1, false, 0,
- ITEM_RIFLE, 0, 0, 0, 0, 0
- }, {
- "Machine Gunner", 300, 0.9, DEP_NONE,
- 1, ARMOD_NOCHANGE,
- 2, 1, false, 0,
- ITEM_MACHINEGUN, 0, 0, 0, 0, 0
- }, {
- "Grenadier", 550, 0.8, DEP_BARRACKS,
- 2, ARMOD_EXPLO,
- 4, 2, true, 0,
- ITEM_GRENADE, ITEM_RIFLE, 0, 0, 0, 0
- }, {
- "Rocket Soldier", 500, 0.7, DEP_BARRACKS,
- 2, ARMOD_EXPLO,
- 2, 2, false, 0,
- ITEM_MISSILE, ITEM_RIFLE, 0, 0, 0, 0
- }, {
- "Stealth Trooper", 600, 0.95, DEP_NONE,
- -1, ARMOD_NOCHANGE,
- 2, 2, false, CF_STEALTH,
- ITEM_STEALTH, ITEM_KNIFE, 0, 0, 0, 0
- }, {
- "Gauss Gunner", 600, 0.8, DEP_BARRACKS,
- 2, ARMOD_LASER,
- 2, 1, false, 0,
- ITEM_GAUSS, ITEM_RIFLE, 0, 0, 0, 0
- }, {
- "Chem Warrior", 550, 0.7, DEP_BARRACKS,
- 2, ARMOD_CHEM,
- 2, 1, false, 0,
- ITEM_CHEMSPRAY, 0, 0, 0, 0, 0
- }, {
- "Shock Trooper", 600, 0.7, DEP_CENTRE,
- 2, ARMOD_LASER,
- 2, 1, false, 0,
- ITEM_SHOCKRIFLE, 0, 0, 0, 0, 0
- }, {
- "Commando", 1000, 0.85, DEP_CENTRE,
- 2, ARMOD_BULLET,
- 4, 2, true, CF_WARNING|CF_NOMECHS,
- ITEM_GAUSS, ITEM_MISSILE, ITEM_GATLING, ITEM_RIFLE, 0, 0
- }, {
- "Shotgunner", 0, 0.8, DEP_NONE,
- 0, ARMOD_NOCHANGE,
- 1, 1, false, 0,
- ITEM_SHOTGUN, 0, 0, 0, 0, 0
- }, {
- "Suicide Bomber", 1750, 1.0, DEP_NONE,
- 0, ARMOD_NOCHANGE,
- 0, 0, false, CF_NOPISTOL|CF_NOMECHS|CF_WARNING|CF_SUPPORT,
- ITEM_BOMBPACK, 0, 0, 0, 0, 0
- }, {
- "Sniper", 750, 0.675, DEP_CENTRE,
- 1, ARMOD_NOCHANGE,
- 2, 1, false, CF_SNIPER,
- ITEM_SNIPER, 0, 0, 0, 0, 0
- }, {
- "Utility Guy", 650, 0.75, DEP_NONE,
- 2, ARMOD_NOCHANGE,
- 1, 1, true, CF_NOMECHS|CF_SUPPORT,
- ITEM_UTILITY, ITEM_REPAIR, 0, 0, 0, 0
- }, {
- "Demolitions Expert", 550, 0.75, DEP_NONE,
- 2, ARMOD_EXPLO,
- 4, 4, true, CF_NOMECHS|CF_SUPPORT,
- ITEM_BOMBSQUAD, ITEM_SHOTGUN, ITEM_REMOTEC4, ITEM_MINE_X6, 0, 0
- }, {
- "Field Medic", 300, 0.85, DEP_NONE,
- 2, ARMOD_CHEM,
- 2, 1, false, CF_MEDIC|CF_SUPPORT,
- ITEM_HEALGUN, ITEM_TIBRIFLEWEAK, ITEM_MEDFIELD, 0, 0, 0
- }, {
- "Laser Chaingunner", 650, 0.75, DEP_CENTRE,
- 2, ARMOD_LASER,
- 2, 1, false, 0,
- ITEM_LASERCHAIN, 0, 0, 0, 0, 0
- }, {
- "Jet Trooper", 600, 0.65, DEP_BARRACKS,
- 2, ARMOD_NOCHANGE,
- 2, 1, false, 0,
- ITEM_JETGUN, 0, 0, 0, 0, 0
- }, {
- "Tiberium Autorifleman", 400, 0.8, DEP_BARRACKS,
- 1, ARMOD_CHEM,
- 2, 1, false, 0,
- ITEM_TIBRIFLE, 0, 0, 0, 0, 0
- }, {
- "Double Shotgunner", 200, 0.8, DEP_NONE,
- 1, ARMOD_NOCHANGE,
- 1, 1, false, 0,
- ITEM_SSG, 0, 0, 0, 0, 0
- }, {
- "Plasma Gunner", 800, 0.7, DEP_CENTRE,
- 2, ARMOD_LASER,
- 2, 1, true, 0,
- ITEM_PLASMA, 0, 0, 0, 0, 0
- }, {
- "Artillery Soldier", 600, 0.7, DEP_BARRACKS,
- 2, ARMOD_EXPLO,
- 2, 1, true, 0,
- ITEM_ARTILLERY, ITEM_RIFLE, 0, 0, 0, 0
- }, {
- "Time Cop", 2000, 0.9, DEP_CENTRE,
- 2, ARMOD_NOCHANGE,
- 4, 2, true, CF_WARNING|CF_NOMECHS|CF_SUPPORT,
- ITEM_TIMEGUN, ITEM_MACHINEGUN, 0, 0, 0, 0
- }, {
- "Advanced Harvester", 750, 0.8, DEP_REFINERY,
- 1, ARMOD_CHEM,
- 2, 1, false, CF_HARVESTER|CF_NOMECHS|CF_SUPPORT,
- ITEM_MACHINEGUN, 0, 0, 0, 0, 0
- }, {
- "Tiberium Harvester", 0, 0.65, DEP_REFINERY,
- 0, ARMOD_CHEM,
- 1, 1, false, CF_HARVESTER|CF_SUPPORT,
- ITEM_SMG, 0, 0, 0, 0, 0
- }
- };
- // Add-on definitions
- #define ADDON_BEACON 5
- #define MAX_ADDONS 6
- #define MAX_ADDON_KEYS 3
- #define ADK_NAME 0
- #define ADK_COST 1
- #define ADK_ITEM 2
- int AddOns[MAX_ADDONS][MAX_ADDON_KEYS] = {
- {"+1 Armor", 250, ITEM_ARMORUP},
- {"Tiberium Autorifle", 300, ITEM_TIBRIFLEWEAK},
- {"Artillery Cannon", 550, ITEM_ARTILLERY},
- {"Chainsaw", 250, ITEM_CHAINSAW},
- {"Plasma Cannon", 1500, ITEM_BFG},
- {"Superweapon Beacon", 1750, ITEM_BEACON}
- };
- // Tries to purchase a class for the player. If purchase wasn't possible,
- // this returns the appropriate error message. Otherwise, returns 0.
- function str PurchaseClass (int id) {
- int cost = Classes[id][CK_COST];
- // Check barracks
- if (Classes[id][CK_DEPENDENCY] == DEP_BARRACKS)
- if (!CheckBarracks (1-PlayerTeam ()))
- return "Your barracks have been destroyed!";
- // Check research centre
- if (Classes[id][CK_DEPENDENCY] == DEP_CENTRE)
- if (!CheckPlant (1-PlayerTeam ()))
- return "Your research centre has been destroyed!";
- // Check refinery
- if (Classes[id][CK_DEPENDENCY] == DEP_REFINERY)
- if (!CheckRefinery (1-PlayerTeam ()))
- return "Your refinery has been destroyed!";
- // If the class is a time cop, we need to check the limit
- int max = GetCVar ("aow_maxtimecopsperteam");
- if (Classes[id][CK_FLAGS] & CF_TIMECOP && max > 0 && NumTimeCops[1-PlayerTeam ()] >= max)
- return "Timecops at limit!";
- // Must not have a class already
- if (!IsResigned())
- return "You must resign first!";
- // Must afford it!
- if (!CanAfford (cost))
- return "You need more credits!";
- TakeInventory ("PurchaseToken", 1);
- SpendCredits (cost);
- if (!SetClass (id, 0))
- return "Couldn't set the class! Something's going nuts here!";
- return 0;
- }
- // Sets the player class
- #define SCF_NOTELEPORT 1 // don't teleport the player to his base
- #define SCF_NOBEEP 2 // no beep sound
- function bool SetClass (int id, int scflags) {
- if (id < 0 || id > MAX_CLASSES) {
- Log (s:"SetClass: Tried to set an unknown class ", d:id, s:"!");
- return false;
- }
- int cflags = Classes[id][CK_FLAGS];
- str name = Classes[id][CK_NAME];
- // Display message to purchaser
- if (!(scflags & SCF_NOBEEP))
- DisplayTick ();
- SetFont ("BIGFONT");
- HudMessage (s:"You are a \cf", s:name, s:"!";
- HUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);
- // If the class is flagged as dangerous, also print a warning to others
- if (cflags & CF_WARNING) {
- SetFont ("SMALLFONT");
- if (PlayerTeam () == TEAM_RED)
- HudMessageBold (s:"\cGWarning: \cARed\cJ ", s:name, s:" in-field!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- else
- HudMessageBold (s:"\cGWarning: \cNBlue\cJ ", s:name, s:" in-field!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- }
- // The essentials
- GiveInventory ("HasClass", 1);
- GiveInventory ("Refunds", Classes[id][CK_COST] / 2);
- GiveInventory ("ClassID", id);
- // Speed and armor
- SetSpeed (Classes[id][CK_SPEED]);
- SetArmorGrade (Classes[id][CK_ARMOR], Classes[id][CK_ARMOD]);
- // Give a handgun unless undesired
- if (!(cflags & CF_NOPISTOL))
- GiveItem (ITEM_HANDGUN, false);
- // C4
- int c4 = Classes[id][CK_C4];
- if (c4 > 0) {
- SetInventory ("TimedC4", c4);
- SetInventory ("TimedC4Count", c4);
- }
- // Frag grenades
- SetFragGrenades (Classes[id][CK_FRAGS]);
- // If the class is a sniper, flag as such
- if (cflags & CF_SNIPER)
- GiveInventory ("IsSniper", 1);
- // If the class shouldn't use mechs, flag as such
- if (cflags & CF_NOMECHS)
- GiveInventory ("HighUpgrade", 1);
- // If the class is flagged as a medic, they should get the regeneration
- if (cflags & CF_MEDIC) {
- GiveInventory ("IsMedic", 1);
- ACS_ExecuteAlways (352, 0);
- }
- // If the class is counts as a time cop, the limit has to be
- // recounted now.
- if (cflags & CF_TIMECOP)
- RecountTimeCops ();
- // If the class is flagged as a harvester, they should be able
- // to collect Tiberium
- if (cflags & CF_HARVESTER) {
- GiveInventory ("IsHarvester", 1);
- GiveInventory ("TiberiumProof", 1);
- // They do less damage than others
- GiveInventory ("Grade0Damage", 1);
- // Info message
- SetFont ("BIGFONT");
- HudMessage (s:"Pick-up \cDtiberium crystals \c-and";
- HUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GRAY, 0.5, 0.6, 2.0, 1.0);
- HudMessage (s:"return them to your \cDrefinery \c-for \cQcash!";
- HUDMSG_FADEOUT, 1880+PlayerNumber(), CR_GRAY, 0.5, 0.65, 2.0, 1.0);
- }
- // Stealth troopers have a specific death sound
- if (cflags & CF_STEALTH)
- SetActorProperty (0, APROP_DeathSound, "stealth/death");
- // Give the player the weapons and items. The weapon
- // in the first slot is considered primary, and
- // the player will select it.
- for (int i = 0; i <= 5; i++)
- GiveItem (Classes[id][CK_ITEM0 + i], !i);
- // Check for rank for possible upgrades
- ACS_ExecuteAlways (91, 0);
- // Send the player to field unless undesired
- if (!(scflags & SCF_NOTELEPORT)) {
- ACS_ExecuteAlways (961, 0, 1-PlayerTeam ());
- GiveInventory ("SpawnInvulnerability", 1);
- }
- // Save the player speed for morph handling
- PlayerSpeeds[PlayerNumber()] = Classes[id][CK_SPEED];
- Log(n:0, s:" becomes ", s:Classes[id][CK_NAME]);
- return true;
- }
- /* Class scripts. This (and a_weapons) is what
- * remains of that old copy/paste nightmare ;)
- *
- * These now just call the menu
- */
- script 20 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 21 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 22 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 23 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 24 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 25 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 26 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 27 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 28 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 29 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 33 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 35 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 38 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 62 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 40 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 41 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 42 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 43 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 44 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 52 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 53 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 54 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 60 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- script 61 (void) ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- // Classes with post-purchase sounds
- script 39 (void) {
- /*if (PurchaseClass (CLASS_TIMECOP)) {
- Delay(35*6);
- ActivatorSound ("misc/commando", 127);
- }*/
- ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- }
- script 34 (void) {
- /*if (PurchaseClass (CLASS_CHEMWARRIOR)) {
- delay (35*6);
- ActivatorSound ("misc/chem", 127);
- }*/
- ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- }
- script 36 (void) {
- /*if (PurchaseClass (CLASS_COMMANDO)) {
- Delay(35*6);
- ActivatorSound ("misc/commando", 127);
- }*/
- ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- }
- script 63 (void) {
- /*if (PurchaseClass (CLASS_HARVESTER)) {
- delay (35*6);
- ActivatorSound ("misc/chem", 127);
- }*/
- ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- }
- script 64 (int Team) {
- /*if (PurchaseClass (CLASS_ADVHARVESTER)) {
- delay (35*6);
- ActivatorSound ("misc/chem", 127);
- }*/
- ACS_ExecuteAlways (970, 0, MENU_PURCHASE);
- }
- // A player tries to buy an addon from the menu
- function void MenuAddonPurchase (int sel1) {
- if (sel1 < 0 || sel1 > MAX_ITEMS) {
- MenuResponse (MSGTYPE_ERROR, "Bad item!");
- return;
- }
- str name = AddOns[sel1][ADK_NAME];
- int cost = AddOns[sel1][ADK_COST];
- int item = AddOns[sel1][ADK_ITEM];
- // Check if the player already has this
- if (Items[item][IK_WEAPONNAME] != 0) {
- if (CheckInventory (Items[item][IK_WEAPONNAME])) {
- MenuResponse (MSGTYPE_ERROR, "You already have this!");
- return;
- }
- } else if (Items[item][IK_AMMONAME] != 0) {
- if (CheckInventory (Items[item][IK_AMMONAME])) {
- MenuResponse (MSGTYPE_ERROR, "You already have this!");
- return;
- }
- } else {
- MenuResponse (MSGTYPE_ERROR, "Bad item!");
- return;
- }
- // Item-specific checks
- switch (item) {
- case ITEM_BFG:
- // === Plasma cannon
- // Gamemasters go past all this
- if (IsAdmin[PlayerNumber()])
- break;
- // Check cooldown
- if (PlasmaCooldown[PlayerNumber()] > Timer()) {
- int wait = (PlasmaCooldown[PlayerNumber()] - Timer()) / 35;
- LocalAmbientSound ("misc/nope", 127);
- HudMessage(s:"You must wait \cF", d:wait, s:" seconds\c- before\n",
- s:"purchasing another \cNplasma cannon!";
- HUDMSG_FADEOUT, MENU_HID + 100, CR_RED, UMENU_X5, UMENU_Y5, 2.0, 1.0);
- return;
- }
- int max = GetCVAR("aow_maxcannonsperteam");
- if (NumPlasmaCannons[PlayerTeam()] >= max && max != -1) {
- MenuResponse (MSGTYPE_ERROR, "Your team already has too many of those!");
- return;
- }
- if (Timer() < CannonPurchaseDelay) {
- LocalAmbientSound ("misc/nope", 127);
- HudMessage(s:"You must wait \cF", d:(CannonPurchaseDelay - Timer()) / 60,
- s:" seconds\nbefore you can get one of these!";
- HUDMSG_FADEOUT, MENU_HID + 100, CR_RED, UMENU_X5, UMENU_Y5, 2.0, 1.0);
- return;
- }
- // Warning
- SetFont ("SMALLFONT");
- if (PlayerTeam () == TEAM_RED)
- HudMessageBold (s:"\cGWarning: \cARed\cJ player has \cNPlasma Cannon!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- else
- HudMessageBold (s:"\cGWarning: \cNBlue\cJ player has \cNPlasma Cannon!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- // Limits
- RecountPlasma ();
- break;
- case ITEM_BEACON:
- if (IsAdmin[PlayerNumber()])
- break;
- // Check if we already have the beacon
- if (CheckInventory("IonCannonBeacon") || CheckInventory("NuclearStrikeBeacon")) {
- MenuResponse (MSGTYPE_ERROR, "You already have that!");
- return;
- }
- // Check cooldown
- int time = (BeaconPurchaseDelay - (Timer() - LastPurchasedBeacon[PlayerTeam()]) / 35);
- if (time > 0) {
- int mins = BlueBeaconTime/60 - Timer()/(35*60);
- int secs = 59 - (Timer()/35)%60;
- LocalAmbientSound ("misc/nope", 127);
- HudMessage (s:"You must wait \cF", d:time, s:" seconds\nbefore you can get one of these!";
- HUDMSG_FADEOUT, MENU_HID + 100, CR_RED, UMENU_X5, UMENU_Y5, 2.0, 1.0);
- return;
- }
- LastPurchasedBeacon[PlayerTeam()] = Timer();
- // Warning announcement
- if (PlayerTeam () == TEAM_BLUE)
- HudMessageBold (s:"\cGWarning: \cNBlue\cJ team has \cNIon Cannon Beacon!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- else
- HudMessageBold (s:"\cGWarning: \cARed\cJ team has \cANuclear Strike Beacon!";
- HUDMSG_FADEOUT, 15000, CR_WHITE,
- INTEL_XPOS, INTEL_YPOS, 2.0, 1.0);
- break;
- }
- // Check cost
- Log (s:AddOns[sel1][ADK_NAME], s:" costs ", d:AddOns[sel1][ADK_COST]);
- if (CheckCredits () < cost) {
- MenuResponse (MSGTYPE_ERROR, "You need more credits!");
- return;
- }
- // Item is good, give it to the player
- SpendCredits (cost);
- GiveItem (item, false);
- str dname = GetAddOnName (sel1);
- Log(n:0, s:" purchases ", s:dname, s:".");
- // Tell the player he got the item
- SetFont ("SMALLFONT");
- LocalAmbientSound ("c4/use", 127);
- HudMessage (s:"You got the \cf", s:dname, s:"\c-!";
- HUDMSG_FADEOUT, MENU_HID + 100, CR_GREEN, UMENU_X4, UMENU_Y4 - 0.2, 3.0, 1.0);
- // Special messages
- switch (item) {
- case ITEM_CHAINSAW:
- HudMessage(s:"Use Alt-Fire to throw the chainsaw!";
- HUDMSG_FADEOUT, MENU_HID + 101, CR_GREEN, UMENU_X4, UMENU_Y4 - 0.225, 4.0, 1.0);
- break;
- case ITEM_BEACON:
- HudMessage(s:"Place this in front of an \cAenemy MCT\cJ and guard\n",
- s:"it for \cU60 seconds\cJ for \cKcertain destruction!";
- HUDMSG_FADEOUT, MENU_HID + 101, CR_GREEN, UMENU_X4, UMENU_Y4 - 0.225, 8.0, 1.0);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement