sry didn´t think of that
Files:
• battlemages.sma
• bmconst.inc
• bmelemental.inc
• bmenergy.inc
• bmgeneralfuncs.inc
• bmgvars.inc
• bmhelp.inc
• bmillusion.inc
• bmlife.inc
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* battlemages.sma *
//* *
//********************************************* ******************
#include <amxmodx>
#include <amxmisc>
#include <string>
#include <fun>
#include <engine>
#include "effectconst"
// Include files to separate code - makes it easier to read.
#include "bmconst"
#include "bmgvars"
#include "bmhelp"
// Cast magic functions
#include "bmelemental"
#include "bmenergy"
#include "bmillusion"
#include "bmlife"
#include "bmgeneralfuncs"
public plugin_precache()
{
// Precache sprites
g_spriteBurning = precache_model("sprites/xfire.spr");
g_spriteLightning = precache_model("sprites/lgtning.spr");
g_spriteShockwave = precache_model("sprites/shockwave.spr");
g_spriteExplosion = precache_model("sprites/zerogxplode.spr");
g_spriteSmoke = precache_model("sprites/steam1.spr");
// Precache Sounds
if (file_exists("sound/battlemages/fireball.wav"))
precache_sound("battlemages/fireball.wav");
if (file_exists("sound/battlemages/cure.wav"))
precache_sound("battlemages/cure.wav");
if ( file_exists("sound/battlemages/lightningbolt.wav") )
precache_sound("battlemages/lightningbolt.wav");
if ( file_exists("sound/battlemages/invisibility.wav") )
precache_sound("battlemages/invisibility.wav");
if ( file_exists("sound/battlemages/earthquake.wav") )
precache_sound("battlemages/earthquake.wav");
if ( file_exists("sound/battlemages/coldwind.wav") )
precache_sound("battlemages/coldwind.wav");
if ( file_exists("sound/battlemages/thunder_speed.wav") )
precache_sound("battlemages/thunder_speed.wav");
if ( file_exists("sound/battlemages/shield.wav") )
precache_sound("battlemages/shield.wav");
if ( file_exists("sound/battlemages/regeneration.wav") )
precache_sound("battlemages/regeneration.wav");
if ( file_exists("sound/battlemages/mind_blast.wav") )
precache_sound("battlemages/mind_blast.wav");
if ( file_exists("sound/battlemages/planar_armor.wav") )
precache_sound("battlemages/planar_armor.wav");
return PLUGIN_CONTINUE;
}
public plugin_init()
{
register_plugin("Battle Mages", "0.1.4", "Van der Cal");
// Magic commands
register_clcmd("bm_castmagic" , "ClCmdCastMagic");
register_clcmd("bm_nextmagic" , "ClCmdNextMagic");
register_clcmd("bm_prevmagic" , "ClCmdPrevMagic");
register_clcmd("bm_changeschool" , "ClCmdChangeSchool");
// bmhelp.inc ClCmdHelp function
register_clcmd("bm_help" , "ClCmdHelp");
// bmhelp.inc ClCmdSchoolHelp function
register_clcmd("bm_schoolhelp" , "ClCmdSchoolHelp");
// Say handler
register_clcmd("say","SayHandler");
register_clcmd("say_team","SayHandler");
// Testing
//register_clcmd("t1", "ClCmdT1");
// Menu Commands
register_menucmd(register_menuid("Select School:"), 1023, "SchoolChoice" );
// Events
register_event("ResetHUD", "NewRound", "b");
register_event("CurWeapon","ChangeWeapon","be ","1=1");
register_event("SetFOV","Zoomed","be","1<90") ;
register_event("SetFOV","Unzoomed","be","1=90 ");
register_event("Damage", "DamageEvent", "b", "2!0");
// cvars
// Magic Points available at start
register_cvar(CVAR_START_MAGIC_POINTS, "30", FCVAR_SERVER);
// Amount of time(seconds) you have to wait until you can cast magic again
register_cvar(CVAR_MAGIC_COOLDOWN, "15", FCVAR_SERVER);
// Where to position the player information
register_cvar(CVAR_PLAYER_INFO_POSITION, "0", FCVAR_SERVER);
// Get game message id:s
g_iGameMsgScrShake = get_user_msgid("ScreenShake");
g_iGameMsgDeath = get_user_msgid("DeathMsg");
// Run config file
new sConfigFilepath[64];
get_customdir(sConfigFilepath, 63);
format(sConfigFilepath, 63, "%s/battlemages/battlemages.cfg", sConfigFilepath);
server_cmd("exec %s",sConfigFilepath);
return PLUGIN_CONTINUE;
}
//public ClCmdT1(iPlayerID)
//{
// client_print(iPlayerID, print_center, "Current health: %d", get_user_health(iPlayerID));
// return PLUGIN_HANDLED;
//}
// Function that will run when a player connects to the server
public client_connect(id)
{
// Reset values
g_iArrPlayersSchool[id] = WARRIOR;
g_iArrPlayersMP[id] = 0;
g_iArrPlayersSelMagic[id] = 0;
g_iArrPlSelMagicPower[id] = 0;
g_iArrPlSelMagicCost[id] = 0;
g_iArrPlayersMaxHP[id] = 100;
g_bArrPlayersIsHasted[id] = false;
g_bArrPlayersIsSlowed[id] = false;
g_bArrPlayersIsMagicReady[id] = true;
g_iArrPlayersNextSchool[id] = DONT_CHANGE_SCHOOL;
g_bArrPlayersIsZoomMode[id] = false;
g_bArrPlayersDeathMsgShown[id] = false;
g_bArrPlayersHasMagmaShield[id] = false;
}
// Client Command functions
public ClCmdCastMagic(iPlayerID)
{
if ( g_iArrPlayersSchool[iPlayerID] == WARRIOR )
{
client_print(iPlayerID, print_center, "Warriors are not able to wield magic");
return PLUGIN_HANDLED;
}
if ( g_iArrPlayersSchool[iPlayerID] > NUMBER_OF_SCHOOLS )
{
server_print("[BM] ERROR: Player belongs to a school that doesnt exist");
g_iArrPlayersSchool[iPlayerID] = WARRIOR;
return PLUGIN_HANDLED;
}
if ( !g_bArrPlayersIsMagicReady[iPlayerID] )
return PLUGIN_HANDLED;
if ( !is_user_alive(iPlayerID) )
return PLUGIN_HANDLED;
new iSpellID = g_iArrPlayersSelMagic[iPlayerID];
if ( g_iArrPlayersMP[iPlayerID] - g_iArrPlSelMagicCost[iPlayerID] < 0 )
{
client_print(iPlayerID, print_center, "You dont have enough MP to cast the spell");
return PLUGIN_HANDLED;
}
new bool:bCastMagic = false;
new iTargetID, iBodyPartID;
switch ( g_iArrPlayersSchool[iPlayerID] )
{
case ELEMENTAL_MAGE:
{
switch( iSpellID )
{
case FIREBALL:
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmelemental.inc CastFireBall function
CastFireBall(iPlayerID);
}
case ICE_IMPLOSION:
{
get_user_aiming(iPlayerID, iTargetID, iBodyPartID);
if ( iTargetID > 0 && iTargetID <= 32 )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmelemental.inc CastIceImplosion function
CastIceImplosion(iPlayerID);
}
}
case MAGMA_SHIELD:
{
if ( !g_bArrPlayersHasMagmaShield[iPlayerID] )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmelemental.inc CastMagmaShield function
CastMagmaShield(iPlayerID);
}
}
}
}
case ENERGY_MAGE:
{
switch( iSpellID )
{
case LIGHTNING_STRIKE:
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmenergy.inc CastLightningStrike function
CastLightningStrike(iPlayerID);
}
case LIGHTNING_SPEED:
{
// if we arent slowed or already hasted.
if ( !g_bArrPlayersIsSlowed[iPlayerID] && !g_bArrPlayersIsHasted[iPlayerID] )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
g_bArrPlayersIsHasted[iPlayerID] = true;
// bmenergy.inc CastLightningSpeed function
CastLightningSpeed(iPlayerID);
}
}
case PLANAR_ARMOR:
{
if ( get_user_armor(iPlayerID) <= 100 )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmenergy.inc CastPlanarShield function
CastPlanarArmor(iPlayerID);
}
}
}
}
case ILLUSION_MAGE:
{
switch( iSpellID )
{
case INVISIBILITY:
{
SpellCooldown(iPlayerID);
bCastMagic = true;
// bmillusion.inc CastInvisibility function
CastInvisibility(iPlayerID);
}
case SHAKING_WORLD:
{
// if we are aiming on a player...
get_user_aiming(iPlayerID, iTargetID, iBodyPartID);
if ( iTargetID > 0 && iTargetID <= 32 )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmillusion.inc CastShakingWorld function
CastShakingWorld(iPlayerID);
}
}
case MIND_BLAST:
{
bCastMagic = true;
SpellCooldown(iPlayerID);
CastMindBlast(iPlayerID);
}
}
}
case LIFE_MAGE:
{
switch( iSpellID )
{
case HEAL_SELF:
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmlife.inc CastHealSelf function
CastHealSelf(iPlayerID);
}
case HEAL_OTHER:
{
// if we are aiming on a teammate...
get_user_aiming(iPlayerID, iTargetID, iBodyPartID);
if ( iTargetID > 0 && iTargetID <= 32 )
{
if ( get_user_team(iPlayerID) == get_user_team(iTargetID) )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmlife.inc CastHealOther function
CastHealOther(iPlayerID);
}
}
}
case SHIELD_YLIEN:
{
// If not already enveloped in the shield of Y'lien...
if ( g_iArrPlayersMaxHP[iPlayerID] < 101 )
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmlife.inc CastShieldYlien function
CastShieldYlien(iPlayerID);
}
}
case REGENERATION:
{
bCastMagic = true;
SpellCooldown(iPlayerID);
// bmlife.inc CastRegeneration function
CastRegeneration(iPlayerID);
}
}
}
default:
{
return PLUGIN_HANDLED;
}
}
// if we did cast magic
if (bCastMagic)
{
g_iArrPlayersMP[iPlayerID] -= g_iArrPlSelMagicCost[iPlayerID];
DisplayPlayerInfo(iPlayerID);
}
return PLUGIN_HANDLED;
}
public ClCmdNextMagic(iPlayerID)
{
if ( g_iArrPlayersSchool[iPlayerID] == WARRIOR )
{
client_print(iPlayerID, print_center, "Warriors are not able to wield magic");
return PLUGIN_HANDLED;
}
if ( g_iArrPlayersSelMagic[iPlayerID] + 1 < g_nArrSpellsInSchool[g_iArrPlayersSchool[iPlayerID]] )
g_iArrPlayersSelMagic[iPlayerID]++;
else
g_iArrPlayersSelMagic[iPlayerID] = 0;
SetSpellSettings(iPlayerID);
DisplayPlayerInfo(iPlayerID);
return PLUGIN_HANDLED;
}
public ClCmdPrevMagic(iPlayerID)
{
if ( g_iArrPlayersSchool[iPlayerID] == WARRIOR )
{
client_print(iPlayerID, print_center, "Warriors are not able to wield magic");
return PLUGIN_HANDLED;
}
if ( g_iArrPlayersSelMagic[iPlayerID] > 0 )
g_iArrPlayersSelMagic[iPlayerID]--;
else
g_iArrPlayersSelMagic[iPlayerID] = g_nArrSpellsInSchool[g_iArrPlayersSchool[iPlayerID]] - 1;
SetSpellSettings(iPlayerID);
DisplayPlayerInfo(iPlayerID);
return PLUGIN_HANDLED;
}
public ClCmdChangeSchool(iPlayerID)
{
//g_bArrPlayersSelSchoolPending[iPlayerID] = true;
//console_print(iPlayerID, "[BM] A menu will appear at the start of the next round.");
DisplayChooseSchool(iPlayerID);
return PLUGIN_HANDLED;
}
public SayHandler(iPlayerID)
{
new sSaid[32];
read_args(sSaid,31);
if ( equali(sSaid,"\"/bm_help\"") || equali(sSaid,"\"bm_help\"") || equali(sSaid,"\"/bmhelp\"") || equali(sSaid,"\"bmhelp\"") )
DisplayHelp(iPlayerID); // bmhelp.inc DisplayHelp function
else if ( equali(sSaid,"\"/bm_schoolinfo\"") || equali(sSaid,"\"bm_schoolinfo\"") || equali(sSaid,"\"/bmschoolinfo\"") || equali(sSaid,"\"bmschoolinfo\"") )
DisplaySchoolHelp(iPlayerID); // bmhelp.inc DisplaySchoolHelp function
else if ( equali(sSaid,"\"/bm_schoolhelp\"") || equali(sSaid,"\"bm_schoolhelp\"") || equali(sSaid,"\"/bmschoolhelp\"") || equali(sSaid,"\"bmschoolhelp\"") )
DisplaySchoolHelp(iPlayerID); // bmhelp.inc DisplaySchoolHelp function
}
// Private functions aiding client command functions
SetSpellSettings(iPlayerID)
{
switch( g_iArrPlayersSchool[iPlayerID])
{
case ELEMENTAL_MAGE:
{
g_iArrPlSelMagicPower[iPlayerID] = g_iArrElementalMagicPowers[g_iArrPlayersSelMagic[iPlayerID]];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrElementalMagicCost[g_iArrPlayersSelMagic[iPlayerID]];
}
case ENERGY_MAGE:
{
g_iArrPlSelMagicPower[iPlayerID] = g_iArrEnergyMagicPowers[g_iArrPlayersSelMagic[iPlayerID]];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrEnergyMagicCost[g_iArrPlayersSelMagic[iPlayerID]];
}
case ILLUSION_MAGE:
{
g_iArrPlSelMagicPower[iPlayerID] = g_iArrIllusionMagicPowers[g_iArrPlayersSelMagic[iPlayerID]];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrIllusionMagicCost[g_iArrPlayersSelMagic[iPlayerID]];
}
case LIFE_MAGE:
{
g_iArrPlSelMagicPower[iPlayerID] = g_iArrLifeMagicPowers[g_iArrPlayersSelMagic[iPlayerID]];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrLifeMagicCost[g_iArrPlayersSelMagic[iPlayerID]];
}
}
}
// Event functions
public NewRound(iPlayerID)
{
if ( g_iArrPlayersNextSchool[iPlayerID] != DONT_CHANGE_SCHOOL && g_iArrPlayersSchool[iPlayerID] != g_iArrPlayersNextSchool[iPlayerID] )
ChangeSchool(iPlayerID);
else if ( g_iArrPlayersSchool[iPlayerID] == WARRIOR )
DisplayChooseSchool(iPlayerID);
RemoveActiveSpells(iPlayerID);
g_bArrPlayersIsZoomMode[iPlayerID] = false;
g_bArrPlayersDeathMsgShown[iPlayerID] = false;
return PLUGIN_CONTINUE;
}
public ChangeWeapon(iPlayerID)
{
if ( g_bArrPlayersIsHasted[iPlayerID] )
set_user_maxspeed(iPlayerID, float(LIGHTNING_SPEED_POWER));
else if ( g_bArrPlayersIsSlowed[iPlayerID] )
set_user_maxspeed(iPlayerID, ICE_IMPLOSION_SLOW_SPEED);
return PLUGIN_CONTINUE;
}
public SchoolChoice(iPlayerID, iSchoolKey)
{
if ( iSchoolKey >= 0 && iSchoolKey < NUMBER_OF_SCHOOLS)
{
// Check if the player already belongs to that school
if ( iSchoolKey + 1 != g_iArrPlayersSchool[iPlayerID] )
{
g_iArrPlayersNextSchool[iPlayerID] = iSchoolKey + 1;
if ( g_iArrPlayersSchool[iPlayerID] == WARRIOR )
ChangeSchool(iPlayerID);
else
client_print(iPlayerID, print_center, "Your choice has been noted, you will change school next round");
}
else
{
g_iArrPlayersNextSchool[iPlayerID] = DONT_CHANGE_SCHOOL;
client_print(iPlayerID, print_center, "You are part of that school already");
}
}
return PLUGIN_CONTINUE;
}
public Zoomed(iPlayerID)
g_bArrPlayersIsZoomMode[iPlayerID] = true;
public Unzoomed(iPlayerID)
g_bArrPlayersIsZoomMode[iPlayerID] = false;
public DamageEvent(iVictimID)
{
if ( g_bArrPlayersHasMagmaShield[iVictimID] )
{
new iDamage = read_data(2);
new iAttackerID, iBodyPartID, iWeaponID;
iAttackerID = get_user_attacker(iVictimID, iWeaponID, iBodyPartID);
// bmelemental.inc AttackOnMagmaShield function
AttackOnMagmaShield(iVictimID, iAttackerID, iDamage, iBodyPartID, iWeaponID);
}
}
// General Functions
RemoveActiveSpells(iPlayerID)
{
if ( task_exists(INVISIBILITY_DURATION_TASK_ID + iPlayerID) ) // Removes active Invisibility Spells
{
remove_task(INVISIBILITY_DURATION_TASK_ID + iPlayerID);
set_user_rendering(iPlayerID);
}
if ( task_exists(ICE_IMPLOSION_DOT_TASK_ID + iPlayerID) ) // Removes active Ice Implosion Spells
remove_task(ICE_IMPLOSION_DOT_TASK_ID + iPlayerID);
if ( task_exists(FIREBALL_FLY_TASK_ID + iPlayerID) ) // Removes active Fireball
remove_task(FIREBALL_FLY_TASK_ID + iPlayerID);
if ( task_exists(SPELL_COOLDOWN_TASK_ID + iPlayerID) ) // Removes active spell cooldowns
remove_task(SPELL_COOLDOWN_TASK_ID + iPlayerID);
if ( task_exists(LIGHTNING_SPEED_TASK_ID + iPlayerID) ) // Removes active Lightning Speed Spells
remove_task(LIGHTNING_SPEED_TASK_ID + iPlayerID);
if ( g_bArrPlayersIsSlowed[iPlayerID] || g_bArrPlayersIsHasted[iPlayerID] )
{
// bmgeneralfuncs.inc ResetMaxSpeed function
ResetMaxSpeed(iPlayerID);
}
if ( task_exists(MIND_BLAST_TASK_ID + iPlayerID) ) // Removes active Mind Blast Spells
remove_task(MIND_BLAST_TASK_ID + iPlayerID);
if ( task_exists(REGENERATION_TASK_ID + iPlayerID) ) // Removes active Regeneration Spells
remove_task(REGENERATION_TASK_ID + iPlayerID);
if ( get_user_armor(iPlayerID) > 100 ) // Removes active planar armor spells
set_user_armor(iPlayerID, 100);
if ( g_bArrPlayersHasMagmaShield[iPlayerID] ) // Remove active magma shield spells
{
g_bArrPlayersHasMagmaShield[iPlayerID] = false;
}
set_user_rendering(iPlayerID);
g_iArrPlayersMP[iPlayerID] = get_cvar_num(CVAR_START_MAGIC_POINTS);
g_iArrPlayersMaxHP[iPlayerID] = 100;
g_bArrPlayersIsMagicReady[iPlayerID] = true;
g_bArrPlayersIsHasted[iPlayerID] = false;
}
public SpellCooldown(iPlayerID)
{
g_bArrPlayersIsMagicReady[iPlayerID] = false;
new args[1];
args[0] = iPlayerID;
set_task(float(get_cvar_num(CVAR_MAGIC_COOLDO WN)), "ReadyToCast", SPELL_COOLDOWN_TASK_ID + iPlayerID, args, 1);
}
public ReadyToCast(args[])
{
g_bArrPlayersIsMagicReady[args[0]] = true;
client_print(args[0], print_center, "You have regained your focus and can cast your next spell.");
}
ChangeSchool(iPlayerID)
{
switch ( g_iArrPlayersNextSchool[iPlayerID] )
{
case ELEMENTAL_MAGE:
{
g_iArrPlayersSchool[iPlayerID] = ELEMENTAL_MAGE;
g_iArrPlSelMagicPower[iPlayerID] = g_iArrElementalMagicPowers[INITIAL_SPELL];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrElementalMagicCost[INITIAL_SPELL];
}
case ENERGY_MAGE:
{
g_iArrPlayersSchool[iPlayerID] = ENERGY_MAGE;
g_iArrPlSelMagicPower[iPlayerID] = g_iArrEnergyMagicPowers[INITIAL_SPELL];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrEnergyMagicCost[INITIAL_SPELL];
}
case ILLUSION_MAGE:
{
g_iArrPlayersSchool[iPlayerID] = ILLUSION_MAGE;
g_iArrPlSelMagicPower[iPlayerID] = g_iArrIllusionMagicPowers[INITIAL_SPELL];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrIllusionMagicCost[INITIAL_SPELL];
}
case LIFE_MAGE:
{
g_iArrPlayersSchool[iPlayerID] = LIFE_MAGE;
g_iArrPlSelMagicPower[iPlayerID] = g_iArrLifeMagicPowers[INITIAL_SPELL];
g_iArrPlSelMagicCost[iPlayerID] = g_iArrLifeMagicCost[INITIAL_SPELL];
}
}
g_bArrPlayersIsMagicReady[iPlayerID] = true;
g_iArrPlayersSelMagic[iPlayerID] = INITIAL_SPELL;
g_iArrPlayersNextSchool[iPlayerID] = DONT_CHANGE_SCHOOL;
DisplayPlayerInfo(iPlayerID);
}
// Display Functions
public DisplayChooseSchool(iPlayerID)
{
new sMenu[MAX_MENU_SIZE];
format(sMenu,MAX_MENU_SIZE,"Select School:\n\n1. %s\n2. %s\n3. %s\n4. %s\n9. Exit", g_sArrMagicSchools[ELEMENTAL_MAGE],
g_sArrMagicSchools[ENERGY_MAGE], g_sArrMagicSchools[ILLUSION_MAGE], g_sArrMagicSchools[LIFE_MAGE]);
show_menu(iPlayerID, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9), sMenu, -1);
}
DisplayPlayerInfo(iPlayerID)
{
new sActiveSpellName[MAX_CHARS_SPELL_NAME];
switch ( g_iArrPlayersSchool[iPlayerID] )
{
case WARRIOR: sActiveSpellName = "None";
case ELEMENTAL_MAGE: format(sActiveSpellName, MAX_CHARS_SPELL_NAME - 1, "%s", g_sArrElementalMagics[g_iArrPlayersSelMagic[iPlayerID]]);
case ENERGY_MAGE: format(sActiveSpellName, MAX_CHARS_SPELL_NAME - 1, "%s", g_sArrEnergyMagics[g_iArrPlayersSelMagic[iPlayerID]]);
case ILLUSION_MAGE: format(sActiveSpellName, MAX_CHARS_SPELL_NAME - 1, "%s", g_sArrIllusionMagics[g_iArrPlayersSelMagic[iPlayerID]]);
case LIFE_MAGE: format(sActiveSpellName, MAX_CHARS_SPELL_NAME - 1, "%s", g_sArrLifeMagics[g_iArrPlayersSelMagic[iPlayerID]]);
}
new iPlayerInfoPosition = get_cvar_num(CVAR_PLAYER_INFO_POSITION);
switch ( iPlayerInfoPosition )
{
case POSITION_DOWN_LEFT:
set_hudmessage(200, 200, 200, -2.0, 0.75, 0, 6.0, 2.0, 0.1, 0.5,HUD_PLAYERINFO);
case POSITION_DOWN_RIGHT:
set_hudmessage(200, 200, 200, 1.0, 0.75, 0, 6.0, 2.0, 0.1, 0.5,HUD_PLAYERINFO)
case POSITION_DOWN_CENTER:
set_hudmessage(200, 200, 200, -1.0, 0.75, 0, 6.0, 2.0, 0.1, 0.5,HUD_PLAYERINFO)
default:
{
server_print("[BM] Error in cvar %s, invalid value", CVAR_PLAYER_INFO_POSITION);
return PLUGIN_CONTINUE;
}
}
show_hudmessage(iPlayerID, "School: %s\nActive Spell: %s, Cost: %dMP\nMP Left: %d",
g_sArrMagicSchools[g_iArrPlayersSchool[iPlayerID]], sActiveSpellName, g_iArrPlSelMagicCost[iPlayerID], g_iArrPlayersMP[iPlayerID]);
return PLUGIN_CONTINUE;
}
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmconst.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_CONSTANTS
#define BATTLE_MAGES_CONSTANTS
// General Defines
#define MAX_MENU_SIZE 512
#define INITIAL_SPELL 0
#define PLAYER_RADIUS 80
#define MAX_CHARS_SPELL_NAME 20
#define MAX_CHARS_SCHOOL_NAME 32
#define HUD_PLAYERINFO 1
#define DONT_CHANGE_SCHOOL 0
#define DONT_REMOVE_FRAG 1 // for user_kill function
#define NOT_USED 0
#define GET_AIM_ENTITY_HIT 3 // For use with get_user_origin, mode 3
#define ABNORMAL_HEALTH 1024
// CVAR names
#define CVAR_MAGIC_COOLDOWN "mp_magicdelay"
#define CVAR_START_MAGIC_POINTS "mp_startmp"
#define CVAR_PLAYER_INFO_POSITION "mp_bmplayerinfopos"
// Player info positions
#define POSITION_DOWN_LEFT 0
#define POSITION_DOWN_RIGHT 1
#define POSITION_DOWN_CENTER 2
// Task IDs
#define SPELL_COOLDOWN_TASK_ID 700
#define INVISIBILITY_DURATION_TASK_ID 735
#define FIREBALL_FLY_TASK_ID 770
#define EXPLOSION_TASK_ID 805
#define ICE_IMPLOSION_DOT_TASK_ID 840
#define LIGHTNING_SPEED_TASK_ID 875
#define SHAKE_WORLD_TASK_ID 910
#define MIND_BLAST_TASK_ID 945
#define REGENERATION_TASK_ID 980
// Magics sorted by school:
#define NUMBER_OF_SCHOOLS 4
#define WARRIOR 0
#define ELEMENTAL_MAGE 1
#define ENERGY_MAGE 2
#define ILLUSION_MAGE 3
#define LIFE_MAGE 4
// Elemental Magics
#define NUMBER_OF_MAGICS_ELEMENTAL 3
// Name of spell Type of spell
// Fireball AE Nuke
#define FIREBALL 0
#define FIREBALL_POWER 25 // times 3 area damage
#define FIREBALL_COST 7
#define FIREBALL_SPEED 80
#define FIREBALL_SIZE 20
#define NUMBER_LOOPS 3
#define EXPLOSION_RANGE 300
#define BLAST_RADIUS 250
// Ice Implosion DoT + Slow
#define ICE_IMPLOSION 1
#define ICE_IMPLOSION_POWER 5
#define ICE_IMPLOSION_COST 7
#define ICE_IMPLOSION_DURATION 60
#define ICE_IMPLOSION_TURNS 5
#define ICE_IMPLOSION_INTERVAL 2.0
#define ICE_IMPLOSION_SLOW_SPEED 125.0
// Magma Shield Round Buff
#define MAGMA_SHIELD 2
#define MAGMA_SHIELD_POWER 0.25 // %
#define MAGMA_SHIELD_COST 10
#define MAGMA_SHIELD_MIRROR_DMG 0.10 // %
// Energy Magics
#define NUMBER_OF_MAGICS_ENERGY 3
// Lightning Strike Nuke
#define LIGHTNING_STRIKE 0
#define LIGHTNING_STRIKE_POWER 50
#define LIGHTNING_STRIKE_COST 5
// Lightning Speed Duration Buff
#define LIGHTNING_SPEED 1
#define LIGHTNING_SPEED_POWER 330
#define LIGHTNING_SPEED_COST 10
#define LIGHTNING_SPEED_DURATION 30
// Planar Shield Round Buff
#define PLANAR_ARMOR 2
#define PLANAR_ARMOR_POWER 200
#define PLANAR_ARMOR_COST 10
// Leech Self Heal + DoT // ONLY AN IDEA SO FAR
#define LEECH 3
#define LEECH_POWER 10
#define LEECH_COST 10
#define LEECH_DURATION 30.0
#define LEECH_INTERVALS 2
// Illusion Magics
#define NUMBER_OF_MAGICS_ILLUSION 3
// Invisibility Duration Buff
#define INVISIBILITY 0
#define INVISIBILITY_POWER 50
#define INVISIBILITY_COST 10
#define INVISIBILITY_DURATION 30
// Shaking World Confusion
#define SHAKING_WORLD 1
#define SHAKING_WORLD_POWER 0 // Not used
#define SHAKING_WORLD_COST 5
#define SHAKING_WORLD_DURATION 5.0 // Duration / Interval
#define SHAKING_WORLD_INTERVALS 2 // 2 intervals are minimum
// Mind Blast AoE DoT + Confusion
#define MIND_BLAST 2
#define MIND_BLAST_POWER 20 // times 2 area damage
#define MIND_BLAST_COST 10
#define MIND_BLAST_DURATION 5.0 // Duration / Interval
#define MIND_BLAST_INTERVALS 2 // 2 intervals are minimum
#define MIND_BLAST_RANGE 300
// Life Magics
#define NUMBER_OF_MAGICS_LIFE 4
// Heal Self Healing
#define HEAL_SELF 0
#define HEAL_SELF_POWER 50
#define HEAL_SELF_COST 6
// Heal Other Healing
#define HEAL_OTHER 1
#define HEAL_OTHER_POWER 50
#define HEAL_OTHER_COST 6
// Shield of Y'lien Round Buff
#define SHIELD_YLIEN 2
#define SHIELD_YLIEN_POWER 50
#define SHIELD_YLIEN_COST 10
// Regeneration Healing
#define REGENERATION 3
#define REGENERATION_POWER 5 // HP/s
#define REGENERATION_COST 10
#define REGENERATION_DURATION 2.0 // Duration / Interval
#define REGENERATION_INTERVALS 20 // 1 interval is minimum
//
// Damage Causes
#define DMG_CAUSE_FIREBALL 0
#define DMG_CAUSE_LIGHTNING_STRIKE 1
#define DMG_CAUSE_ICE_IMPLOSION 2
#define DMG_CAUSE_MAGMA_SHIELD 3
#define DMG_CAUSE_MIND_BLAST 4
#endif
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmelemental.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_ELEMENTAL_MAGIC
#define BATTLE_MAGES_ELEMENTAL_MAGIC
#include "bmconst"
#include "bmgvars"
#include "bmgeneralfuncs"
CastFireBall(iPlayerID)
{
new vecTarget[3];
new vecStep[3];
new vecOrigin[3];
// new float:fVecNewOrigin[3];
// new float:fVecHit[3];
// new float:fVecNewTarget[3];
new args[11];
new iDistance;
new nSteps;
get_user_origin(iPlayerID, vecOrigin);
get_user_origin(iPlayerID, vecTarget, GET_AIM_ENTITY_HIT);
/* new iEntityID;
// new iCount = 1;
fVecNewOrigin[0] = float(vecOrigin[0]);
fVecNewOrigin[1] = float(vecOrigin[1]);
fVecNewOrigin[2] = float(vecOrigin[2]);
fVecNewTarget[0] = float(vecTarget[0]);
fVecNewTarget[1] = float(vecTarget[1]);
fVecNewTarget[2] = float(vecTarget[2]);
iEntityID = trace_line(iPlayerID, fVecNewOrigin, fVecNewTarget, fVecHit);
client_print(0, print_center, "EntityID: %d, playerid: %d", iEntityID, iPlayerID);
*/
/*
while ( iEntityID <= 32 && iEntityID > 0 && iCount < 33)
{
fVecNewOrigin[0] = fVecNewTarget[0];
fVecNewOrigin[1] = fVecNewTarget[1];
fVecNewOrigin[2] = fVecNewTarget[2];
fVecNewTarget[0] = fVecHit[0];
fVecNewTarget[1] = fVecHit[1];
fVecNewTarget[2] = fVecHit[2];
iEntityID = trace_line(iEntityID, fVecNewOrigin, fVecNewTarget, fVecHit);
iCount++;
}
iDistance = get_distance(vecOrigin, fVecHit);
*/
iDistance = get_distance(vecOrigin, vecTarget);
nSteps = iDistance / FIREBALL_SPEED;
// vecStep[0] = (floatround(fVecHit[0]) - vecOrigin[0]) / nSteps;
// vecStep[1] = (floatround(fVecHit[1]) - vecOrigin[1]) / nSteps;
// vecStep[2] = (floatround(fVecHit[2]) - vecOrigin[2]) / nSteps;
vecStep[0] = (vecTarget[0] - vecOrigin[0]) / nSteps;
vecStep[1] = (vecTarget[1] - vecOrigin[1]) / nSteps;
vecStep[2] = (vecTarget[2] - vecOrigin[2]) / nSteps;
// args[0] = floatround(fVecHit[0]);
// args[1] = floatround(fVecHit[1]);
// args[2] = floatround(fVecHit[2]);
args[0] = vecTarget[0];
args[1] = vecTarget[1];
args[2] = vecTarget[2];
args[3] = iPlayerID;
args[4] = vecStep[0];
args[5] = vecStep[1];
args[6] = vecStep[2];
args[7] = vecOrigin[0];
args[8] = vecOrigin[1];
args[9] = vecOrigin[2];
args[10] = g_iArrPlSelMagicPower[iPlayerID];
if ( file_exists("sound/battlemages/fireball.wav") )
emit_sound(iPlayerID, CHAN_ITEM, "battlemages/fireball.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
set_task(0.1, "FireBallFly", FIREBALL_FLY_TASK_ID + iPlayerID, args, 11);
return PLUGIN_HANDLED;
}
public FireBallFly(args[])
{
new vecTarget[3];
vecTarget[0] = args[0];
vecTarget[1] = args[1];
vecTarget[2] = args[2];
new iCasterID = args[3];
new vecStep[3];
vecStep[0] = args[4];
vecStep[1] = args[5];
vecStep[2] = args[6];
new vecPos[3];
vecPos[0] = args[7];
vecPos[1] = args[8];
vecPos[2] = args[9];
vecPos[0] += vecStep[0];
vecPos[1] += vecStep[1];
vecPos[2] += vecStep[2];
if ( get_distance(vecTarget, vecPos) < PLAYER_RADIUS )
{
Explosion(vecTarget, iCasterID, args[10]);
return PLUGIN_CONTINUE;
}
new iArrPlayersID[32];
new nPlayers;
get_players(iArrPlayersID, nPlayers, "a");
new vecPlayerPos[3];
for (new iPlayer=0; iPlayer < nPlayers; iPlayer++)
{
if ( iArrPlayersID[iPlayer] != iCasterID )
{
get_user_origin(iArrPlayersID[iPlayer], vecPlayerPos);
if ( get_distance(vecPlayerPos, vecPos) < PLAYER_RADIUS )
{
Explosion(vecPlayerPos, iCasterID, args[10]);
return PLUGIN_CONTINUE;
}
}
}
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_SPRITE );
write_coord(vecPos[0] - ( vecStep[0] / 3 * 2 ));
write_coord(vecPos[1] - ( vecStep[1] / 3 * 2 ));
write_coord(vecPos[2] - ( vecStep[2] / 3 * 2 ));
write_short( g_spriteBurning );
write_byte( FIREBALL_SIZE );
write_byte( 200 );
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_SPRITE );
write_coord(vecPos[0] - ( vecStep[0] / 3 ));
write_coord(vecPos[1] - ( vecStep[1] / 3 ));
write_coord(vecPos[2] - ( vecStep[2] / 3 ));
write_short( g_spriteBurning );
write_byte( FIREBALL_SIZE );
write_byte( 200 );
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_SPRITE );
write_coord(vecPos[0]);
write_coord(vecPos[1]);
write_coord(vecPos[2]);
write_short( g_spriteBurning );
write_byte( FIREBALL_SIZE );
write_byte( 200 );
message_end();
args[7] = vecPos[0];
args[8] = vecPos[1];
args[9] = vecPos[2];
set_task(0.1, "FireBallFly", FIREBALL_FLY_TASK_ID + iCasterID, args, 11);
return PLUGIN_CONTINUE;
}
Explosion(vecOrigin[], iCasterID, iDamage)
{
new args[6];
args[0] = vecOrigin[0];
args[1] = vecOrigin[1];
args[2] = vecOrigin[2];
args[3] = iCasterID;
args[4] = NUMBER_LOOPS;
args[5] = iDamage;
set_task(0.1, "Implosion", 1, vecOrigin, 3);
set_task(0.2, "Explode", EXPLOSION_TASK_ID + iCasterID, args, 6);
set_task(0.3, "BlastCircles", 2, vecOrigin, 3);
return PLUGIN_CONTINUE;
}
public Explode(args[])
{
new iCasterID = args[3];
new vecBlastPos[3];
vecBlastPos[0] = args[0];
vecBlastPos[1] = args[1];
vecBlastPos[2] = args[2];
message_begin( MSG_PVS, SVC_TEMPENTITY, vecBlastPos );
write_byte( TE_EXPLOSION);
write_coord( vecBlastPos[0] + random_num( -100, 100 ));
write_coord( vecBlastPos[1] + random_num( -100, 100 ));
write_coord( vecBlastPos[2] + random_num( -50, 50 ));
write_short( g_spriteExplosion );
write_byte( random_num(0, 20) + 20 );
write_byte( 12 );
write_byte( TE_EXPLFLAG_NONE );
message_end();
message_begin( MSG_PVS, SVC_TEMPENTITY, vecBlastPos );
write_byte( TE_SMOKE );
write_coord( vecBlastPos[0] + random_num( -100, 100 ));
write_coord( vecBlastPos[1] + random_num( -100, 100 ));
write_coord( vecBlastPos[2] + random_num( -50, 50 ));
write_short( g_spriteSmoke );
write_byte( 60 );
write_byte( 10 );
message_end();
new iArrPlayersID[32];
new nPlayers;
get_players(iArrPlayersID, nPlayers, "a");
new iTargetID;
new iDistanceBetween;
new vecTargetOrigin[3];
new iDamage;
new iMultiplier;
// bmgeneralfunc.inc IsFriendlyFireOn function
new bool:bFF = IsFriendlyFireOn();
for (new iPlayer = 0; iPlayer < nPlayers; iPlayer++)
{
iTargetID = iArrPlayersID[iPlayer];
get_user_origin(iTargetID, vecTargetOrigin);
iDistanceBetween = get_distance(vecBlastPos, vecTargetOrigin);
if ( get_user_team(iCasterID) != get_user_team(iTargetID) || iCasterID == iTargetID || bFF)
{
if ( iDistanceBetween < EXPLOSION_RANGE )
{
iMultiplier = args[5] * args[5] / EXPLOSION_RANGE;
// bmgeneralfunc.inc SquareRoot function
iDamage = SquareRoot((EXPLOSION_RANGE - iDistanceBetween) * iMultiplier);
// RadiusDamage(fVecOrigin, 1, 1);
// bmgeneralfunc.inc DoDamage function
DoDamage(iTargetID, iCasterID, iDamage, DMG_CAUSE_FIREBALL);
}
}
if (iDistanceBetween < EXPLOSION_RANGE)
{
message_begin(MSG_ONE, g_iGameMsgScrShake, {0,0,0}, iTargetID);
write_short( 1<<14 ); // Amplitude
write_short( 1<<13 ); // Duration
write_short( 1<<14 ); // Frequency
message_end();
}
}
if (--args[4] > 0)
set_task(0.1, "Explode", EXPLOSION_TASK_ID + iCasterID, args, 6);
return PLUGIN_CONTINUE;
}
public BlastCircles(vecBlastPos[3])
{
// Blast Circles
message_begin( MSG_PAS, SVC_TEMPENTITY, vecBlastPos );
write_byte( TE_BEAMCYLINDER );
write_coord( vecBlastPos[0]);
write_coord( vecBlastPos[1]);
write_coord( vecBlastPos[2] - 16);
write_coord( vecBlastPos[0]);
write_coord( vecBlastPos[1]);
write_coord( vecBlastPos[2] - 16 + BLAST_RADIUS);
write_short( g_spriteShockwave );
write_byte( 0 ); // Startframe
write_byte( 0 ); // Framerate
write_byte( 6 ); // Life
write_byte( 16 ); // Width
write_byte( 0 ); // Noise
write_byte( 188 );
write_byte( 220 );
write_byte( 255 );
write_byte( 255 ); // Brightness
write_byte( 0 ); // Speed
message_end();
message_begin( MSG_PAS, SVC_TEMPENTITY, vecBlastPos );
write_byte( TE_BEAMCYLINDER );
write_coord( vecBlastPos[0]);
write_coord( vecBlastPos[1]);
write_coord( vecBlastPos[2] - 16);
write_coord( vecBlastPos[0]);
write_coord( vecBlastPos[1]);
write_coord( vecBlastPos[2] - 16 + BLAST_RADIUS / 2);
write_short( g_spriteShockwave );
write_byte( 0 ); // Startframe
write_byte( 0 ); // Framerate
write_byte( 6 ); // Life
write_byte( 16 ); // Width
write_byte( 0 ); // Noise
write_byte( 188 );
write_byte( 220 );
write_byte( 255 );
write_byte( 255 ); // Brightness
write_byte( 0 ); // Speed
message_end();
return PLUGIN_CONTINUE;
}
public Implosion(vecImplosionPos[3])
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_IMPLOSION );
write_coord(vecImplosionPos[0]);
write_coord(vecImplosionPos[1]);
write_coord(vecImplosionPos[2]);
write_byte(100);
write_byte(20);
write_byte(5);
message_end();
return PLUGIN_CONTINUE;
}
CastIceImplosion(iCasterID)
{
// new vecTarget[3];
new iTargetID, iBodyPartID;
get_user_aiming(iCasterID, iTargetID, iBodyPartID);
// bmgeneralfunc.inc IsFriendlyFireOn function
new bool:bFF = IsFriendlyFireOn();
if ( iTargetID > 0 && iTargetID <= 32 )
{
if (!bFF)
if ( get_user_team(iCasterID) == get_user_team(iTargetID) )
return PLUGIN_CONTINUE;
new args[4];
args[0] = iCasterID;
args[1] = iTargetID;
args[2] = ICE_IMPLOSION_TURNS;
args[3] = g_iArrPlSelMagicPower[iCasterID];
if ( file_exists("sound/battlemages/coldwind.wav") )
emit_sound(iCasterID, CHAN_ITEM, "battlemages/coldwind.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
set_user_maxspeed(iTargetID, ICE_IMPLOSION_SLOW_SPEED);
g_bArrPlayersIsSlowed[iTargetID] = true;
IceImplosionEffect(iTargetID);
// bmgeneralfunc.inc DoDamage function
DoDamage(iTargetID, iCasterID, g_iArrPlSelMagicPower[iCasterID], DMG_CAUSE_ICE_IMPLOSION);
set_task(ICE_IMPLOSION_INTERVAL, "IceImplosionDOT", ICE_IMPLOSION_DOT_TASK_ID + iCasterID, args, 4);
}
return PLUGIN_HANDLED;
}
public IceImplosionDOT(args[])
{
new iCasterID = args[0];
new iTargetID = args[1];
if ( is_user_alive(iTargetID) )
{
IceImplosionEffect(iTargetID);
// bmgeneralfunc.inc DoDamage function
DoDamage(iTargetID, iCasterID, args[3], DMG_CAUSE_ICE_IMPLOSION);
if (--args[2] > 0)
set_task(ICE_IMPLOSION_INTERVAL, "IceImplosionDOT", ICE_IMPLOSION_DOT_TASK_ID + iCasterID, args, 4);
else
{
if (g_bArrPlayersIsHasted[iTargetID])
set_user_maxspeed(iTargetID, float(LIGHTNING_SPEED_POWER));
else
{
// bmgeneralfuncs.inc ResetMaxSpeed function
ResetMaxSpeed(iTargetID);
}
}
}
else
{
// bmgeneralfuncs.inc ResetMaxSpeed function
ResetMaxSpeed(iTargetID);
}
return PLUGIN_CONTINUE;
}
IceImplosionEffect(iTargetID)
{
new vecImplosionPos[3];
get_user_origin(iTargetID, vecImplosionPos);
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_IMPLOSION );
write_coord(vecImplosionPos[0]);
write_coord(vecImplosionPos[1]);
write_coord(vecImplosionPos[2]);
write_byte(100);
write_byte(20);
write_byte(5);
message_end();
}
CastMagmaShield(iCasterID)
{
set_user_health(iCasterID, get_user_health(iCasterID) + ABNORMAL_HEALTH);
g_bArrPlayersHasMagmaShield[iCasterID] = true;
if ( file_exists("sound/battlemages/fireball.wav") )
emit_sound(iCasterID, CHAN_ITEM, "battlemages/fireball.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
// Adds a red aura indicating that this player is using Magma shield.
set_user_rendering(iCasterID, kRenderFxGlowShell, 255, 25, 25, kRenderTransAlpha, 255);
return PLUGIN_HANDLED;
}
AttackOnMagmaShield(iCasterID, iAttackerID, iDamage, iBodyPartID, iWeaponID)
{
set_user_health(iCasterID, get_user_health(iCasterID) + floatround( float(iDamage) * MAGMA_SHIELD_POWER )); // Reduce damage
if ( iCasterID != iAttackerID )
DoDamage(iAttackerID, iCasterID, floatround( float(iDamage) * MAGMA_SHIELD_MIRROR_DMG ), DMG_CAUSE_MAGMA_SHIELD);
if ( get_user_health(iCasterID) < ABNORMAL_HEALTH + 1 )
{
new iHeadShot = 0;
if ( iBodyPartID == HIT_HEAD )
iHeadShot = 1;
DoDamage(iCasterID, iAttackerID, ABNORMAL_HEALTH + 1, iWeaponID, true, iHeadShot);
}
}
#endif
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmenergy.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_ENERGY_MAGIC
#define BATTLE_MAGES_ENERGY_MAGIC
#include "bmconst"
#include "bmgvars"
#include "bmgeneralfuncs"
CastLightningStrike(iPlayerID)
{
// bmgeneralfunc.inc IsFriendlyFireOn function
new bool:bFF = IsFriendlyFireOn();
new iEnemyID, iBodyPart;
new iLinewidth = 50;
new vecTarget[3];
new vecCaster[3];
get_user_origin(iPlayerID, vecCaster);
get_user_aiming(iPlayerID, iEnemyID, iBodyPart);
// if aimed on a player...
if ( iEnemyID > 0 && iEnemyID <= 32 )
{
if (!bFF)
if ( get_user_team(iPlayerID) == get_user_team(iEnemyID) )
return PLUGIN_CONTINUE;
get_user_origin(iEnemyID, vecTarget);
LightningEffect(vecCaster, vecTarget, iLinewidth, iPlayerID);
// bmgeneralfunc.inc DoDamage function
DoDamage(iEnemyID, iPlayerID, g_iArrPlSelMagicPower[iPlayerID], DMG_CAUSE_LIGHTNING_STRIKE);
}
else
{
get_user_origin(iPlayerID, vecTarget, 3);
LightningEffect(vecCaster, vecTarget, iLinewidth, iPlayerID);
}
return PLUGIN_CONTINUE;
}
public LightningEffect(vecCaster[], vecTarget[], iLinewidth, iCasterID)
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMPOINTS );
// Start Position
write_coord(vecCaster[0]);
write_coord(vecCaster[1]);
write_coord(vecCaster[2]);
// End Position
write_coord(vecTarget[0]);
write_coord(vecTarget[1]);
write_coord(vecTarget[2]);
write_short( g_spriteLightning );
write_byte( 0 ); // Starting frame
write_byte( 15 ); // Frame rate
write_byte( 5 ); // Life
write_byte( iLinewidth ); // Line width
write_byte( 10 ); // Noise amplitude
write_byte( 255 ); // Red color
write_byte( 255 ); // Green color
write_byte( 255 ); // Blue color
write_byte( 255 ); // Brightness
write_byte( 0 ); // Scroll speed
message_end();
if ( file_exists("sound/battlemages/lightningbolt.wav") )
emit_sound(iCasterID, CHAN_ITEM, "battlemages/lightningbolt.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
return PLUGIN_CONTINUE;
}
CastLightningSpeed(iCasterID)
{
set_user_maxspeed(iCasterID, float(g_iArrPlSelMagicPower[iCasterID]));
new args[1];
args[0] = iCasterID;
if ( file_exists("sound/battlemages/thunder_speed.wav") )
emit_sound(iCasterID, CHAN_ITEM, "battlemages/thunder_speed.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
message_begin( MSG_ONE, 108, {0,0,0}, iCasterID );
write_byte( LIGHTNING_SPEED_DURATION ); // duration
write_byte( 0 ); // duration
message_end();
set_task(float(LIGHTNING_SPEED_DURATION), "EndLightningSpeed", LIGHTNING_SPEED_TASK_ID + iCasterID, args, 1);
return PLUGIN_HANDLED;
}
public EndLightningSpeed(args[])
{
new iCasterID = args[0];
if ( !g_bArrPlayersIsSlowed[iCasterID] )
{
// bmgeneralfuncs.inc ResetMaxSpeed function
ResetMaxSpeed(iCasterID);
}
return PLUGIN_CONTINUE;
}
CastPlanarArmor(iCasterID)
{
set_user_armor(iCasterID, PLANAR_ARMOR_POWER);
if ( file_exists("sound/battlemages/planar_armor.wav") )
emit_sound(iCasterID, CHAN_ITEM, "battlemages/planar_armor.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
// Adds a blue aura indicating that this player is using Planar armor.
set_user_rendering(iCasterID, kRenderFxGlowShell, 25, 25, 255, kRenderTransAlpha, 255);
return PLUGIN_HANDLED;
}
#endif
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmgeneralfuncs.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_GENERAL_FUNCTIONS
#define BATTLE_MAGES_GENERAL_FUNCTIONS
#include "bmconst"
bool:IsFriendlyFireOn()
{
if(cvar_exists("mp_friendlyfire"))
{
new iFF = get_cvar_num("mp_friendlyfire");
return (iFF == 1);
}
else
return false;
return false; // Not really needed, but I hate warnings from the compiler
}
stock LogKill(iShooterID, iTargetID, sWeaponDescription[] )
{
new sShooterName[24],sTargetName[24], sShooterAuthID[20], sTargetAuthID[20], sShooterTeamName[8], sTargetTeamName[8];
// Info on Shooter
get_user_name(iShooterID, sShooterName, 23);
get_user_team(iShooterID, sShooterTeamName, 7);
get_user_authid(iShooterID, sShooterAuthID, 19);
// Info on Target
get_user_name(iTargetID, sTargetName, 23);
get_user_team(iTargetID, sTargetTeamName, 7);
get_user_authid(iTargetID, sTargetAuthID, 19);
// Log this Kill
log_message("\"%s<%d><%s><%s>\" killed \"%s<%d><%s><%s>\" with \"%s\"",
sShooterName, get_user_userid(iShooterID), sShooterAuthID, sShooterTeamName,
sTargetName, get_user_userid(iTargetID), sTargetAuthID, sTargetTeamName, sWeaponDescription );
}
DoDamage(iTargetID, iShooterID, iDamage, iDamageCause, bIsWeaponID = false, iHeadShot = 0)
{
new sWeaponOrMagicName[64];
if ( bIsWeaponID )
{
// get_weaponname(iDamageCause, sWeaponOrMagicName, 63); // Doesnt exist yet...
GetWeaponName(iDamageCause, sWeaponOrMagicName, 63);
if ( iDamageCause == CSW_HEGRENADE )
iHeadShot = 0;
}
else
{
switch( iDamageCause )
{
case DMG_CAUSE_FIREBALL:
sWeaponOrMagicName = "Fireball";
case DMG_CAUSE_LIGHTNING_STRIKE:
sWeaponOrMagicName = "Lightning Strike";
case DMG_CAUSE_ICE_IMPLOSION:
sWeaponOrMagicName = "Ice Implosion";
case DMG_CAUSE_MAGMA_SHIELD:
sWeaponOrMagicName = "Magma Shield";
case DMG_CAUSE_MIND_BLAST:
sWeaponOrMagicName = "Mind Blast";
}
}
new bool:bPlayerDied = false;
new iHP = get_user_health(iTargetID);
if ( ( iHP - iDamage ) <= 0 )
bPlayerDied = true;
else if ( g_bArrPlayersHasMagmaShield[iTargetID] && get_user_health(iTargetID) <= ABNORMAL_HEALTH )
bPlayerDied = true;
if (bPlayerDied)
{
// engine.inc set_msg_block function
set_msg_block(g_iGameMsgDeath, BLOCK_ONCE)
user_kill(iTargetID, DONT_REMOVE_FRAG)
// set_user_health(iTargetID, -1);
}
else
set_user_health(iTargetID, iHP - iDamage);
new sShooterName[32];
get_user_name(iShooterID, sShooterName, 31);
if (bPlayerDied)
{
if ( iShooterID != iTargetID )
{
if ( get_user_team(iShooterID) != get_user_team(iTargetID) )
set_user_frags(iShooterID, get_user_frags(iShooterID) + 1);
else
set_user_frags(iShooterID, get_user_frags(iShooterID) - 1);
// set_user_frags(iTargetID, get_user_frags(iTargetID) + 1);
LogKill(iTargetID, iShooterID, sWeaponOrMagicName);
}
g_bArrPlayersDeathMsgShown[iTargetID] = true;
message_begin( MSG_ALL, g_iGameMsgDeath, {0,0,0}, 0);
write_byte(iShooterID);
write_byte(iTargetID);
write_byte(iHeadShot);
write_string(sWeaponOrMagicName);
message_end();
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public SquareRoot(iValue)
{
new iDiv = iValue;
new iResult = 1;
while (iDiv > iResult)
{
iDiv = (iDiv + iResult) / 2;
iResult = iValue / iDiv;
}
return iDiv;
}
public ResetMaxSpeed(iPlayerID)
{
g_bArrPlayersIsHasted[iPlayerID] = false;
g_bArrPlayersIsSlowed[iPlayerID] = false;
new iClipAmmo = 0;
new iAmmo = 0;
new iWeaponID = 0;
iWeaponID = get_user_weapon(iPlayerID, iClipAmmo, iAmmo);
switch ( iWeaponID )
{
case CSW_P228:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_SCOUT:
{
if ( g_bArrPlayersIsZoomMode[iPlayerID] )
set_user_maxspeed(iPlayerID, 220.0);
else
set_user_maxspeed(iPlayerID, 260.0);
}
case CSW_HEGRENADE:
set_user_maxspeed(iPlayerID, 260.0);
case CSW_XM1014:
set_user_maxspeed(iPlayerID, 230.0);
case CSW_C4:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_MAC10:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_AUG:
set_user_maxspeed(iPlayerID, 240.0);
case CSW_SMOKEGRENADE:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_ELITE:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_FIVESEVEN:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_UMP45:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_SG550:
{
if ( g_bArrPlayersIsZoomMode[iPlayerID] )
set_user_maxspeed(iPlayerID, 150.0);
else
set_user_maxspeed(iPlayerID, 210.0);
}
case CSW_GALIL:
set_user_maxspeed(iPlayerID, 240.0);
case CSW_FAMAS:
set_user_maxspeed(iPlayerID, 240.0);
case CSW_USP:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_GLOCK18:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_AWP:
{
if ( g_bArrPlayersIsZoomMode[iPlayerID] )
set_user_maxspeed(iPlayerID, 150.0);
else
set_user_maxspeed(iPlayerID, 210.0);
}
case CSW_MP5NAVY:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_M249:
set_user_maxspeed(iPlayerID, 220.0);
case CSW_M3:
set_user_maxspeed(iPlayerID, 240.0);
case CSW_M4A1:
set_user_maxspeed(iPlayerID, 230.0);
case CSW_TMP:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_G3SG1:
{
if ( g_bArrPlayersIsZoomMode[iPlayerID] )
set_user_maxspeed(iPlayerID, 150.0);
else
set_user_maxspeed(iPlayerID, 210.0);
}
case CSW_FLASHBANG:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_DEAGLE:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_SG552:
set_user_maxspeed(iPlayerID, 235.0);
case CSW_AK47:
set_user_maxspeed(iPlayerID, 221.0);
case CSW_KNIFE:
set_user_maxspeed(iPlayerID, 250.0);
case CSW_P90:
set_user_maxspeed(iPlayerID, 245.0);
}
}
bool:GetWeaponName(iWeaponID, sWeaponName[], iLength)
{
switch ( iWeaponID )
{
case CSW_P228:
format(sWeaponName, iLength, "p228");
case CSW_SCOUT:
format(sWeaponName, iLength, "scout");
case CSW_HEGRENADE:
format(sWeaponName, iLength, "grenade");
case CSW_XM1014:
format(sWeaponName, iLength, "xm1014");
case CSW_C4:
format(sWeaponName, iLength, "c4"); // not entirely sure
case CSW_MAC10:
format(sWeaponName, iLength, "mac10");
case CSW_AUG:
format(sWeaponName, iLength, "aug");
case CSW_SMOKEGRENADE:
format(sWeaponName, iLength, "smokegrenade"); // not entirely sure
case CSW_ELITE:
format(sWeaponName, iLength, "elite");
case CSW_FIVESEVEN:
format(sWeaponName, iLength, "fiveseven");
case CSW_UMP45:
format(sWeaponName, iLength, "ump45");
case CSW_SG550:
format(sWeaponName, iLength, "sg550");
case CSW_GALIL:
format(sWeaponName, iLength, "galil"); // not entirely sure
case CSW_FAMAS:
format(sWeaponName, iLength, "famas"); // not entirely sure
case CSW_USP:
format(sWeaponName, iLength, "usp");
case CSW_GLOCK18:
format(sWeaponName, iLength, "glock18");
case CSW_AWP:
format(sWeaponName, iLength, "awp");
case CSW_MP5NAVY:
format(sWeaponName, iLength, "mp5navy");
case CSW_M249:
format(sWeaponName, iLength, "m249");
case CSW_M3:
format(sWeaponName, iLength, "m3");
case CSW_M4A1:
format(sWeaponName, iLength, "m4a1");
case CSW_TMP:
format(sWeaponName, iLength, "tmp");
case CSW_G3SG1:
format(sWeaponName, iLength, "g3sg1");
case CSW_FLASHBANG:
format(sWeaponName, iLength, "flashbang"); // not entirely sure
case CSW_DEAGLE:
format(sWeaponName, iLength, "deagle");
case CSW_SG552:
format(sWeaponName, iLength, "sg552");
case CSW_AK47:
format(sWeaponName, iLength, "ak47");
case CSW_KNIFE:
format(sWeaponName, iLength, "knife");
case CSW_P90:
format(sWeaponName, iLength, "p90");
default:
{
format(sWeaponName, iLength, ""); // not entirely sure
return false;
}
}
return true;
}
#endif
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmgvars.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_GVARS
#define BATTLE_MAGES_GVARS
// Global Variables, Marked by "g_"
// Strings with the names of the diffrent magic schools
new g_sArrMagicSchools[5][] = { "Warrior", "Elemental Mage", "Energy Mage", "Illusion Mage", "Life Mage" };
// Arrays with powers of the diffrent school spells
new g_iArrElementalMagicPowers[] = { FIREBALL_POWER, ICE_IMPLOSION_POWER, NOT_USED };
new g_iArrEnergyMagicPowers[] = { LIGHTNING_STRIKE_POWER, LIGHTNING_SPEED_POWER, NOT_USED };
new g_iArrIllusionMagicPowers[] = { INVISIBILITY_POWER, SHAKING_WORLD_POWER, NOT_USED };
new g_iArrLifeMagicPowers[] = { HEAL_SELF_POWER, HEAL_OTHER_POWER, SHIELD_YLIEN_POWER, NOT_USED };
// Arrays with costs of the diffrent school spells
new g_iArrElementalMagicCost[] = { FIREBALL_COST, ICE_IMPLOSION_COST, MAGMA_SHIELD_COST };
new g_iArrEnergyMagicCost[] = { LIGHTNING_STRIKE_COST, LIGHTNING_SPEED_COST, PLANAR_ARMOR_COST };
new g_iArrIllusionMagicCost[] = { INVISIBILITY_COST, SHAKING_WORLD_COST, MIND_BLAST_COST };
new g_iArrLifeMagicCost[] = { HEAL_SELF_COST, HEAL_OTHER_COST, SHIELD_YLIEN_COST, REGENERATION_COST };
// Arrays with names of the diffrent school spells
new g_sArrElementalMagics[NUMBER_OF_MAGICS_ELEMENTAL][] = { "Fireball", "Ice Implosion", "Magma Shield" };
new g_sArrEnergyMagics[NUMBER_OF_MAGICS_ENERGY][] = { "Lightning Strike", "Lightning Speed", "Planar Armor" };
new g_sArrIllusionMagics[NUMBER_OF_MAGICS_ILLUSION][] = { "Invisibility", "Shaking World", "Mind Blast" };
new g_sArrLifeMagics[NUMBER_OF_MAGICS_LIFE][] = { "Heal Self", "Heal Other", "Shield of Y'lien", "Regeneration" };
// Array with the number of spells in each school
new g_nArrSpellsInSchool[] = { WARRIOR, NUMBER_OF_MAGICS_ELEMENTAL, NUMBER_OF_MAGICS_ENERGY, NUMBER_OF_MAGICS_ILLUSION, NUMBER_OF_MAGICS_LIFE };
// What school the players belongs to
new g_iArrPlayersSchool[33];
// Players Current MP
new g_iArrPlayersMP[33];
// What spell currently selected
new g_iArrPlayersSelMagic[33];
// the power of the selected spell
new g_iArrPlSelMagicPower[33];
// the cost of the selected spell
new g_iArrPlSelMagicCost[33];
// Max hp, so that you cant heal a player over their maxhp
new g_iArrPlayersMaxHP[33];
// Recieves a value if a player wants to change school, 0 as value if they arent changing school
new g_iArrPlayersNextSchool[33];
// The abilities of the current players
//new g_iArrPlAbilities[32][4];
// Booleans
new bool:g_bArrPlayersIsHasted[33] = false;
new bool:g_bArrPlayersIsSlowed[33] = false;
new bool:g_bArrPlayersIsZoomMode[33] = false;
new bool:g_bArrPlayersIsMagicReady[33] = true;
new bool:g_bArrPlayersDeathMsgShown[33] = false;
new bool:g_bArrPlayersHasMagmaShield[33] = false;
// Sprites and messages
new g_spriteBurning, g_spriteLightning, g_spriteShockwave, g_spriteExplosion, g_spriteSmoke;
new g_iGameMsgScrShake, g_iGameMsgDeath;
#endif
//********************************************* ******************
//* Battle Mages v. 0.1.4 for AMXX by Martin J. Van der Cal *
//* *
//* Mod adding magic to the game. *
//* *
//* Copyright (C) 2004, Martin J. Van der Cal *
//* This plugin is under the GNU General Public License, read *
//* "Battle Mages Readme.doc" for further information. *
//* *
//* bmhelp.inc *
//* *
//********************************************* ******************
#if !defined BATTLE_MAGES_HELP
#define BATTLE_MAGES_HELP
public ClCmdHelp(iPlayerID)
{
console_print(iPlayerID, "[BM] <<< Battle Mages - Help >>>");
console_print(iPlayerID, "[BM] Battle Mages introduces magic to cs. To start, you first need to choose a school.");
console_print(iPlayerID, "[BM] Diffrent schools has diffrent magics, a menu in which you can choose a school will");
console_print(iPlayerID, "[BM] appear when it is a new round and if you have yet to choose a school.");
console_print(iPlayerID, "[BM] Now you need to bind a key to be able to cast magic. You do so by typing:");
console_print(iPlayerID, "[BM] bind key bm_castmagic");
console_print(iPlayerID, "[BM] in the console. Where key is the button which you will use to cast magic. Example:");
console_print(iPlayerID, "[BM] bind f bm_castmagic");
console_print(iPlayerID, "[BM] Now, every time you press the f key, you will cast magic.");
console_print(iPlayerID, "[BM] Useful commands to bind:");
console_print(iPlayerID, "[BM] To cast magic:");
console_print(iPlayerID, "[BM] bind key bm_castmagic");
console_print(iPlayerID, "[BM] To choose next magic:");
console_print(iPlayerID, "[BM] bind key bm_nextmagic");
console_print(iPlayerID, "[BM] To choose previous magic:");
console_print(iPlayerID, "[BM] bind key bm_prevmagic");
console_print(iPlayerID, "[BM] To change school:");
console_print(iPlayerID, "[BM] bind key bm_changeschool");
console_print(iPlayerID, "[BM] When you press the bm_changeschool button, you will be able to change school next round.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Type bm_schoolhelp in the console or say chat to display help about the diffrent Schools");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Good Luck");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Forum where you can post your view, suggestions and/or ideas:");
console_print(iPlayerID, "[BM] http://members.lycos.co.uk/ghostwarrior/forum/viewforum.php?f=13&sid=b40fe25fb89a71173f7b0f c00cd04635");
console_print(iPlayerID, "[BM] ");
// console_print(iPlayerID, "[BM] ");
return PLUGIN_HANDLED;
}
public ClCmdSchoolHelp(iPlayerID)
{
console_print(iPlayerID, "[BM] <<< Battle Mages - School Help >>>");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Schools and Magics that are available:");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Elemental Mage - The elemental mage is the master of elements:");
console_print(iPlayerID, "[BM] Fireball - Area Effect Nuke");
console_print(iPlayerID, "[BM] Throws a fireball that will damage everything near it upon impact.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Ice Implosion - Damage over Time with player effect slow");
console_print(iPlayerID, "[BM] Target is assaulted by the coldness of winter.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Magma Shield - Round Buff with reduced damage and mirror damage.");
console_print(iPlayerID, "[BM] The mage become shielded with magma.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Energy Mage - The energy mage is the master of energies:");
console_print(iPlayerID, "[BM] Lightning Strike - Nuke");
console_print(iPlayerID, "[BM] A lightning strikes instantly where the mage point at.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Lightning Speed - Duration Buff with player effect haste.");
console_print(iPlayerID, "[BM] The mage gain the speed of lightning.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Planar Armor - Round Buff");
console_print(iPlayerID, "[BM] The mage becomes enveloped in planar armor.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Illusion Mage - The illusion mage is the master of illusions:");
console_print(iPlayerID, "[BM] Invisibility - Duration Buff with player effect invisibility");
console_print(iPlayerID, "[BM] The mage cloaks himself/herself in an illusion. Disappearing from sight.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Shaking World - Mind Attack with player effect disorientation.");
console_print(iPlayerID, "[BM] An illusion covers the target who thinks the world is shaking.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Mind Blast - Area Effect Damage over Time with player effect disorientation");
console_print(iPlayerID, "[BM] The mage blasts an area with mind power.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Life Mage - The life mage is the master of life:");
console_print(iPlayerID, "[BM] Heal Self - Healing");
console_print(iPlayerID, "[BM] The mage heals himself/herself with 50HP");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Heal Other - Healing");
console_print(iPlayerID, "[BM] The mage heals a teammate with 50HP");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Shield of Y'lien - Round Buff");
console_print(iPlayerID, "[BM] The mage summons a shield, thus receiving 50 more to his max HP.");
console_print(iPlayerID, "[BM] ");
console_print(iPlayerID, "[BM] Regeneration - Duration Buff with player effect regeneration");
console_print(iPlayerID, "[BM] The mage regenerates 5HP/s for a maximum of 100HP.");
console_print(iPlayerID, "[BM] ");
return PLUGIN_HANDLED;
}
DisplayHelp(iPlayerID)
{
new sBattleMagesHelpText[2048];
new iPos = 0;
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "<body bgcolor='#000000' text='#009900'>");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "<<< Battle Mages - Author: Martin J. Van der Cal >>>
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Battle Mages introduces magic to cs. To start, you first need to choose a school.
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Diffrent schools has diffrent magics, a menu in which you can choose a school will
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "appear when it is a new round and if you have yet to choose a school.
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Now you need to bind a key to be able to cast magic. You do so by typing:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind key bm_castmagic
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "in the console. Where key is the button which you will use to cast magic. Example:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind f bm_castmagic
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Now, every time you press the f key, you will cast magic.
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Useful commands to bind:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "To cast magic:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind key bm_castmagic
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "To choose next magic:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind key bm_nextmagic
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "To choose previous magic:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind key bm_prevmagic
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "To change school:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "bind key bm_changeschool
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "When you press the bm_changeschool button, you will be able to change school next
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "round.
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Type bm_schoolhelp in the console or say chat to display help about the diffrent");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "schools.
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Good Luck
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "Forum where you can post your view, suggestions and/or ideas:
");
iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "http://members.lycos.co.uk/ghostwarrior/forum/
");
// iPos += format(sBattleMagesHelpText[iPos], 2048-iPos, "");
show_motd(iPlayerID, sBattleMagesHelpText, "Battle Mages - Help");
}
DisplaySchoolHelp(iPlayerID)
{
new sBattleMagesSchoolHelpText[2048];
new iPos = 0;
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "<body bgcolor='#000000' text='#009900'>");
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "<<< Battle Mages - Author: Martin J. Van der Cal >>>
");
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "
");
switch ( g_iArrPlayersSchool[iPlayerID] )
{
case WARRIOR:
{
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "Warriors doesnt wield magic, select a school first.");
// iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "");
}
case ELEMENTAL_MAGE:
{
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "Elemental Mage - The elemental mage is the master of elements:
");
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "
");
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "Fireball - Area Effect Nuke
");
iPos += format(sBattleMagesSchoolHelpText[iPos], 2048-iPos, "Throws a fireball that explodes upon impact<b