/** * File: * While we do this, lets document this file. I saw a forum post requesting documentation in this file. */ //for all war3source or SH plugins, we define MAXPlAYERS as 66 //just so pigs dont fly when you run a 64 slot server with HLTV #define MAXPLAYERSCUSTOM 66 //+2 of real for normal servers, add +X number of HLTV slots //dochecking up to =MAXRACES-1 #define MAXRACES 200 //20 = [1]-[199] ///can only hold X-1 races, IE 20 can only hold 19 races, we skip zeroth race! #define MAXITEMS 100 // [1]-[19] //(+1 of real number of items, if there are 8 items to load, use 9!! ignore zeroth rule) #define MAXITEMS2 100 //zeroth item not used #define MAXSKILLCOUNT 8 //[1]-[7] //if you want 7 skills, use 8. A SKILL IS GENERIC, set the property "ultimate" to true for ultmates #define DEF_MAX_SKILL_LEVEL 4 //DO NOT CHANGE #define MAXLEVELXPDEFINED 16 //maximum where level XP is defined, if a race has more than MAXLEVELXPDEFINED levles, xp given and xp to next level is still MAXLEVELXPDEFINED #define CUSTOMMODIFIERS 3 //how many race indexes extra for modifying buffs without conflicting other races #define MAXAURAS 100 // [1- ] ignore zeroth index #define SHORTNAMELEN 16 //item or race shotnames, 15 characters #define FULLNAMELEN 32 //item or race full names, 31 characters. RUSSIAN and other characters require more than 1 byte to store a displayed character #define MAXCATS 20 //max race categories #define MAXFACTIONS 20 //max amount of factions w3 can hold #define FACTION_LENGTH 32 //max length of a faction name #define INVALID_DEPENDENCY -1 //describes the default/invalid value of a skill dependency // The enum W3Var is used with function W3SetVar and W3GetVar. // It is the first parameter, eg: new deathRace = W3GetVar(DeathRace) enum W3Var { OldRace, //the race he was before OnRaceChanged //REMOVE DEPRECATED DeathRace, //race when player died hDatabase, // Handle to database hDatabaseType, // DBI driver, ie sqlite or mysql hSaveEnabledCvar, //Handle to war3_savexp hRaceLimitEnabledCvar, // war3_racelimit_enable hNewPlayerLevelbankCvar, // war3_new_player_levelbank TheItemBoughtOrLost, // item in question in events such as item bought or item lost hPlayerInfoArgStr, // string argument after player says "playerinfo " if any RaceinfoRaceToShow, // who to show the raceinfo .... EventArg1, //generic war3event arguments EventArg2, EventArg3, TransClient,//who to translate hUseMetricCvar, //handle to cvar SmEvent, ///usual game events from sm hooked events } stock String:W3VarStrings[][32] = {"OldRace", "DeathRace", "hDatabase", "hDatabaseType", "hSaveEnabledCvar", "hRaceLimitEnabledCvar", "hNewPlayerLevelbankCvar", "TheItemBoughtOrLost", "hPlayerInfoArgStr", "RaceinfoRaceToShow", "EventArg1", "EventArg2", "EventArg3", "TransClient", "hUseMetricCvar", "SmEvent"}; //These are just used as constants, and enum orders them incrementally // They are to be used for War3CreateEvent and OnWar3Event, these constants define the type of the event/ //War3Events are basically used kind of like Natives and Forwards, without the trouble of creating actual natives/forwards enum W3EVENT { Moled=0, BombPlanted, BombDefused, ToBeRevived, DoShowHelpMenu, DoShowChangeRaceMenu, DoShowShopMenu, DoTriedToBuyItem, DoShowItemsInfoMenu, DoShowRaceinfoMenu, DoShowPlayerinfoMenu, DoShowPlayerinfoEntryWithArg, DoShowParticularRaceInfo, ClearPlayerVariables, InitPlayerVariables, DoLevelCheck, DoForwardClientBoughtItem, //tell item ownership to call lost and bought forwards DoForwardClientLostItem, //uses TheItemBoughtOrLost DoShowSpendskillsMenu, PlayerIsNewToServer, DoResetSkills, DoShowWar3Menu, DoShowLevelBank, DoShowWar3Rank, DoShowWar3Stats, DoShowWar3Top, PlayerLeveledUp, DoCheckRestrictedItems, OnPreGiveXPGold, //client, arg1,2,3=W3XPAwardedBy , xp, gold OnPostGiveXPGold, ///xp gold already given, same args as pre CanBuyItem, //client, arg1=itemid, if eventarg2 is non zero, he can buy// you have to do the message on the reason why he can't buy OnDeathPre, //EventArg1 = attacker. before w3 actual death forward is called to do some reading ( ie before items are lost) DoShowMenuMyInfo, DoShowPlayerInfoTarget, ///EventArg1 = target = the person whos info is shown, client=SHOW TO SHMyHeroes, //select a race to drop SHClearPowers, //drop all heroes SHSelectHeroesMenu, //sh changerace //shopmenu2 DoShowShopMenu2, DoTriedToBuyItem2, DoForwardClientBoughtItem2, //tell item ownership to call lost and bought forwards DoForwardClientLostItem2, //uses TheItemBoughtOrLost UNLOADPLUGINSBYMODE,//testing plugin unload DatabaseConnected, DoShowSHMenu, DoShowItems2InfoMenu,//MOVE OnBuffChanged, //a buff has changed OnAuraCalculationFinished, //this is after all the OnW3PlayerAuraStateChanged have been sent DoShowPlayerItemsOwnTarget, ///EventArg1 = target = the person whos items is shown, client=SHOW TO } enum W3DENY{ DN_ShowChangeRace, //can show the menu DN_Suicide, //can undead suicide DN_CanSelectRace, //can select a race, use EventArg1 } // Constants for an array, which every War3 Plugin has. When the variables are ready, they will be forwarded to you. enum W3ForwardedVarsEnum{ EXTAvailable, } //Used as constants...identifies why a player was rewarded XP/Gold enum W3XPAwardedBy { XPAwardByGeneric=0, ///not defined XPAwardByKill, XPAwardByAssist, XPAwardByWin, XPAwardByBomb, //defuse / explode XPAwardByHostage, XPAwardByPointCap, XPAwardByPointCapBlock, XPAwardByFlagCap, XPAwardByHealing, XPAwardByReviving, XPAwardByRescueing, } // The types of immunities you can get/set from. ///corresponds to a buff system immunity enum War3Immunity { Immunity_None = 0, //generic zero Immunity_Ultimates, // Immune from ultimates Immunity_PhysicalDamage, // Immune from health taking Immunity_MagicDamage, // Immune from magic based stuff (doesnt not include ultimates) Immunity_Items, // Immune from shop items Immunity_Skills, // Immune from all skills Immunity_Wards, // Immune ward modifiers/damage. skill immunity includes ward immunity Immunity_Abilities, // Immune from abilities (not implemented by core) }; // The last of PimpinJuice's sexy syntax //where damage is from skill or ultimate etc enum War3DamageOrigin { W3DMGORIGIN_UNDEFINED=0, W3DMGORIGIN_SKILL, W3DMGORIGIN_ULTIMATE, W3DMGORIGIN_ITEM, } //damage types enum War3DamageType { W3DMGTYPE_TRUEDMG=0, //normal damage without accout for physical or magic armor W3DMGTYPE_PHYSICAL, W3DMGTYPE_MAGIC, } // Games that War3Source Supports enum ValveGameEnum { Game_None=0, Game_CS=1, Game_DOD=2, Game_TF=3, Game_L4D=4, Game_L4D2=5, Game_CSGO=6, //Are you feeling Lazy? use this! CS=Game_CS, DOD=Game_DOD, TF=Game_TF, L4D=Game_L4D, L4D2=Game_L4D2, CSGO=Game_CSGO } //Basically Instance variables for the Player Class enum W3PlayerProp { bool:bPutInServer, CurrentRace, PendingRace, PlayerGold, DERPPRERPER,//REMOVE PlayerDiamonds, //DRPECE iMaxHP, bIsDucking, bool:xpLoaded, Float:RaceChosenTime, bool:RaceSetByAdmin, bool:SpawnedOnce, //if player has spawned once Float:sqlStartLoadXPTime, bool:isDeveloper, Float:LastChangeTeamTime, bool:bStatefulSpawn, //set true if spawn is a non repeated spawn. set to true on join and death, set false after spawn forward is finished. } enum W3SkillProp { bool:ActivateOnEnemy, ///TO BE IMPLEMENTED MaxLevel, bool:IsUltimate, SkillName[32], } //EXCLUSIVE: buffs that do not stack with itself: gravity, invisblity, however to make them stack use a second property ie gravity2, invisibilty2 //////////////////Generally races use "buffvar" and items that wish to stack uses "varbuff2" and the final value is calculated: best of "buffvar" stacked with best of "buffvar2" //STACKING: buffs that stack with itself //EACH BUFF SHOULD HAVE A CONCENSUS ON WHAT TYPE OF VALUE IT USES: bool, int, float ///NOT ALL BUFFS HAVE THE SAME DENIES, some only need skill deny or item deny only enum W3BuffProperties { any:DefaultValue=0, //array index 1 BuffStackCacheType:BuffStackType=1, //array index 1 } enum BuffStackCacheType { //each buff can only have one stacking operation:aa DoNotCache=0, bHasOneTrue, iAbsolute, //sum fAbsolute, //sum fStacked, /// all float multiplied fMaximum, fMinimum, iMinimum, iLastValue, ERRUNDEFINED=-99, } enum W3Buff { buffdummy=0, bBuffDenyAll, //DENY=not allowed to have any buffs, aka "purge" fLowGravitySkill, //0.4 ish? fLowGravityItem, //0.4 ish? bLowGravityDenyAll, fInvisibilitySkill, //0.4 ish? fInvisibilityItem, //0.4 ish? bInvisibilityDenyAll, bInvisibilityDenySkill, //needed for orc bDoNotInvisWeapon, bInvisWeaponOverride, //set true to use override amount, ONLY 1 RACE SHALL USE THIS AT A TIME PER CLIENT iInvisWeaponOverrideAmount, ///amolunt of 0-255 , do not have to set back to 255, just set bInvisWeaponOverride to false ///11 fMaxSpeed, //for increasing speeds only! MUST BE MORE THAN 1.0 fMaxSpeed2, //for increasing speeds only!, added onto fMaxSpeed buff, MUST BE MORE THAN 1.0 fSlow, //for decreeasing speeds only! MUST BE LESS THAN 1.0 fSlow2, //for decreeasing speeds only! MUST BE LESS THAN 1.0. allows a race to have stacking slows bSlowImmunity, //immune to slow? bImmunitySkills, //is immune to skills bImmunityUltimates, // is immune to ultimates bImmunityWards, // is immune to wards, skill immunity includes ward immunity bImmunityItems, // is immune to items bImmunityAbilities, // is immune to abilities fAttackSpeed, //attack speed multipler! bStunned, //cannot shoot, cannot cast, cannot move, basically everything below bBashed, //cannot move bDisarm,//cannot shoot bSilenced, //cannot cast bHexed, // no skill proc bPerplexed, //cannot use items / proc items bNoMoveMode,//move type none! overrrides all other movestypes bFlyMode, //fly mode bFlyModeDeny, bNoClipMode, fArmorPhysical, fArmorMagic, //DO NOT USE GLOW FOR INVIS iGlowRed, //glowing the player 0-255 iGlowGreen, iGlowBlue, iGlowAlpha, //careful this is like invisiblity iGlowPriority, //highest priority takes effect fGlowSetTime, //time is recorded, those with same prioirty will compete via time. not something u set fHPRegen, ///float sum! NO NEGATIVES! MINIM regin rate is 0.5 / second ( 1 hp per 2 seconds) fHPDecay, //float sum, NO NEGATIVES, postive means lose this much HP / second, same requirements as fHPRegen fHPRegenDeny, //set true to deny hp regen iAdditionalMaxHealth, ///increase / decrease in maxhp //44 fDodgeChance, //Registers a chance to dodge, (Note: 0.7 would equal a 30% chance to dodge) bDodgeMode, //Set 0 for Pre, 1 for post (quick regen) fVampirePercent, //Sets a % of damage done to give back as health fVampirePercentNoBuff, // Same as fVampirePercent, but doesn't overheal fMeleeVampirePercent, // Sets a % of damage done to give back as health when the damage was caused by melee fMeleeVampirePercentNoBuff, // Same as fMeleeVampirePercent, but doesn't overheal fBashChance, //Registers a chance to bash, (Note: 0.7 would equal a 30% chance to bash) iBashDamage, //Does a certain amount of damage when you bash an enemy (more similar to warcraft 3's bash, default 0) fBashDuration, //Sets the duration of bash's stun fCritChance, //Registers a chance to crit, (Note: 0.7 would equal a 30% chance to crit) iCritMode, //Default 0 (all damage qualifies for crit) 1 (bullet damage crit) 2 (grenade damage crit) 3 (melee damage crit) 4 (melee and bullet crit) 5 (melee and grenade crit) 6 (bullet and grenade crit) fCritModifier, //Sets the critical strike modifer, default 1.0 iDamageMode, //Default 0 (all damage qualifies for damage increase) 1 (bullet damage damage increase) 2 (grenade damage damage increase) 3 (melee damage damage increase) 4 (melee and bullet damage increase) 5 (melee and grenade damage increase) 6 (bullet and grenade damage increase) iDamageBonus, //Gives a direct increase to damage done fDamageModifier, //Gives a % increase to damage done MaxBuffLoopLimitTemp, //this is a variable that is for loops, this number is automatically generated from the enum. } stock MaxBuffLoopLimit=_:MaxBuffLoopLimitTemp; //create an buffpropertiesarray[W3Buff][W3BuffProperties]; (separate from the array that stores every client's buffs) //we fill the array with its properties stock InitiateBuffPropertiesArray(buffpropertiesarray[W3Buff][W3BuffProperties]) { for(new i=0;i