NWScript :
///version modifiee de TalentAdvancedBuff()
///(x0_i0_talent)
///bAllClassSpell :
/// TRUE : le lanceur verifiera s'il possede les sorts de toutes les classes
/// FALSE : (defaut) seulement les sorts ou il possede des niveaux
/// renvoie TRUE si le buff a lieu FALSE sinon
/// Par Sith Vicious
/////////////////////////
#include "x0_inc_generic"
int MyBuff(float fDistance, int bInstant = TRUE, int bAllClassSpell = FALSE)
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if(GetIsObjectValid(oPC))
{
if(GetDistanceToObject(oPC) <= fDistance)
{
//int bPaladin = GetLevelByClass(CLASS_TYPE_PALADIN);
int bMage = bAllClassSpell || GetLevelByClass(CLASS_TYPE_WIZARD) || GetLevelByClass(CLASS_TYPE_SORCERER) || GetLevelByClass(CLASS_TYPE_BARD);
int bDruid = bAllClassSpell || GetLevelByClass(CLASS_TYPE_DRUID);
int bRanger = bAllClassSpell || GetLevelByClass(CLASS_TYPE_RANGER);
int bCleric = bAllClassSpell || GetLevelByClass(CLASS_TYPE_CLERIC);
//int bBard = GetLevelByClass(CLASS_TYPE_BARD);
if (bDruid || bRanger) SummonAnimalCompanion();
if (bMage) SummonFamiliar();
if(!GetIsFighting(OBJECT_SELF))
{
ClearActions(CLEAR_X0_I0_TALENT_AdvancedBuff);
//Combat Protections
if(GetHasSpell(SPELL_PREMONITION) && !GetHasSpellEffect(SPELL_PREMONITION))
{
ActionCastSpellAtObject(SPELL_PREMONITION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GREATER_STONESKIN)&& !GetHasSpellEffect(SPELL_GREATER_STONESKIN))
{
ActionCastSpellAtObject(SPELL_GREATER_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, 0, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_STONESKIN)&& !GetHasSpellEffect(SPELL_STONESKIN))
{
ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BARKSKIN)&& !GetHasSpellEffect(SPELL_BARKSKIN))
{
ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Visage Protections
if(GetHasSpell(SPELL_SHADOW_SHIELD)&& !GetHasSpellEffect(SPELL_SHADOW_SHIELD))
{
ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ETHEREAL_VISAGE)&& !GetHasSpellEffect(SPELL_ETHEREAL_VISAGE))
{
ActionCastSpellAtObject(SPELL_ETHEREAL_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GHOSTLY_VISAGE)&& !GetHasSpellEffect(SPELL_GHOSTLY_VISAGE))
{
ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_DISPLACEMENT)&& !GetHasSpellEffect(SPELL_DISPLACEMENT))
{
ActionCastSpellAtObject(SPELL_DISPLACEMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Mantle Protections
if(GetHasSpell(SPELL_GREATER_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_LESSER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
// Globes
if(GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY)&& !GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY))
{
ActionCastSpellAtObject(SPELL_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY)&& !GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY))
{
ActionCastSpellAtObject(SPELL_MINOR_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Misc Protections
if(GetHasSpell(SPELL_ELEMENTAL_SHIELD)&& !GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD))
{
ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if (GetHasSpell(SPELL_MESTILS_ACID_SHEATH)&& !GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH))
{
ActionCastSpellAtObject(SPELL_MESTILS_ACID_SHEATH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if (GetHasSpell(SPELL_DEATH_ARMOR)&& !GetHasSpellEffect(SPELL_DEATH_ARMOR))
{
ActionCastSpellAtObject(SPELL_DEATH_ARMOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Elemental Protections
if(GetHasSpell(SPELL_ENERGY_BUFFER)&& !GetHasSpellEffect(SPELL_ENERGY_BUFFER))
{
ActionCastSpellAtObject(SPELL_ENERGY_BUFFER, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS)&& !GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_PROTECTION_FROM_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_RESIST_ELEMENTS)&& !GetHasSpellEffect(SPELL_RESIST_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_RESIST_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ENDURE_ELEMENTS)&& !GetHasSpellEffect(SPELL_ENDURE_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_ENDURE_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Mental Protections
if(GetHasSpell(SPELL_MIND_BLANK)&& !GetHasSpellEffect(SPELL_MIND_BLANK))
{
ActionCastSpellAtObject(SPELL_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_MIND_BLANK)&& !GetHasSpellEffect(SPELL_LESSER_MIND_BLANK))
{
ActionCastSpellAtObject(SPELL_LESSER_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CLARITY)&& !GetHasSpellEffect(SPELL_CLARITY))
{
ActionCastSpellAtObject(SPELL_CLARITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Summon Ally
if (GetAssociate(ASSOCIATE_TYPE_SUMMONED)==OBJECT_INVALID)
{
if(GetHasSpell(SPELL_ELEMENTAL_SWARM))
{
ActionCastSpellAtLocation(SPELL_ELEMENTAL_SWARM, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BLACK_BLADE_OF_DISASTER))
{
ActionCastSpellAtLocation(SPELL_BLACK_BLADE_OF_DISASTER, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MORDENKAINENS_SWORD))
{
ActionCastSpellAtLocation(SPELL_MORDENKAINENS_SWORD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_IX))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IX, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GREATER_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_GREATER_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VIII))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VIII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VII))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PLANAR_ALLY))
{
ActionCastSpellAtLocation(SPELL_PLANAR_ALLY, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VI))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VI, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_LESSER_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_V))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_V, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_IV))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IV, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ANIMATE_DEAD))
{
ActionCastSpellAtLocation(SPELL_ANIMATE_DEAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_III))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_III, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_II))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_II, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_I))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE))
{
ActionCastSpellAtLocation(SPELL_SHELGARNS_PERSISTENT_BLADE, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
//boost carac
if(GetHasSpell(SPELL_GREATER_BULLS_STRENGTH) && !GetHasSpellEffect(SPELL_GREATER_BULLS_STRENGTH))
{
ActionCastSpellAtObject(SPELL_GREATER_BULLS_STRENGTH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BULLS_STRENGTH) && !GetHasSpellEffect(SPELL_BULLS_STRENGTH))
{
ActionCastSpellAtObject(SPELL_BULLS_STRENGTH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_EAGLE_SPLENDOR) && !GetHasSpellEffect(SPELL_GREATER_EAGLE_SPLENDOR))
{
ActionCastSpellAtObject(SPELL_GREATER_EAGLE_SPLENDOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_EAGLE_SPLEDOR) && !GetHasSpellEffect(SPELL_EAGLE_SPLEDOR))
{
ActionCastSpellAtObject(SPELL_EAGLE_SPLEDOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_CATS_GRACE) && !GetHasSpellEffect(SPELL_GREATER_CATS_GRACE))
{
ActionCastSpellAtObject(SPELL_GREATER_CATS_GRACE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CATS_GRACE) && !GetHasSpellEffect(SPELL_CATS_GRACE))
{
ActionCastSpellAtObject(SPELL_CATS_GRACE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_FOXS_CUNNING) && !GetHasSpellEffect(SPELL_GREATER_FOXS_CUNNING))
{
ActionCastSpellAtObject(SPELL_GREATER_FOXS_CUNNING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_FOXS_CUNNING) && !GetHasSpellEffect(SPELL_FOXS_CUNNING))
{
ActionCastSpellAtObject(SPELL_FOXS_CUNNING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_OWLS_WISDOM) && !GetHasSpellEffect(SPELL_GREATER_OWLS_WISDOM))
{
ActionCastSpellAtObject(SPELL_GREATER_OWLS_WISDOM, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_OWLS_WISDOM) && !GetHasSpellEffect(SPELL_OWLS_WISDOM))
{
ActionCastSpellAtObject(SPELL_OWLS_WISDOM, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_ENDURANCE) && !GetHasSpellEffect(SPELL_GREATER_ENDURANCE))
{
ActionCastSpellAtObject(SPELL_GREATER_ENDURANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ENDURANCE) && !GetHasSpellEffect(SPELL_ENDURANCE))
{
ActionCastSpellAtObject(SPELL_ENDURANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Autres protections
if(GetHasSpell(SPELL_DEATH_WARD) && !GetHasSpellEffect(SPELL_DEATH_WARD))
{
ActionCastSpellAtObject(SPELL_DEATH_WARD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT) && !GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT))
{
ActionCastSpellAtObject(SPELL_FREEDOM_OF_MOVEMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION) && !GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION))
{
ActionCastSpellAtObject(SPELL_NEGATIVE_ENERGY_PROTECTION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_PROTECTION_FROM_SPELLS) && !GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS))
{
ActionCastSpellAtObject(SPELL_PROTECTION_FROM_SPELLS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_SHIELD_OF_FAITH) && !GetHasSpellEffect(SPELL_SHIELD_OF_FAITH))
{
ActionCastSpellAtObject(SPELL_SHIELD_OF_FAITH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_SPELL_RESISTANCE) && !GetHasSpellEffect(SPELL_SPELL_RESISTANCE))
{
ActionCastSpellAtObject(SPELL_SPELL_RESISTANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Autres boost
if(GetHasSpell(SPELL_BLESS) && !GetHasSpellEffect(SPELL_BLESS))
{
ActionCastSpellAtObject(SPELL_BLESS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_AID) && !GetHasSpellEffect(SPELL_AID))
{
ActionCastSpellAtObject(SPELL_AID, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MASS_HASTE) && !GetHasSpellEffect(SPELL_MASS_HASTE))
{
ActionCastSpellAtObject(SPELL_MASS_HASTE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_HASTE) && !GetHasSpellEffect(SPELL_HASTE))
{
ActionCastSpellAtObject(SPELL_HASTE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_RESISTANCE) && !GetHasSpellEffect(SPELL_RESISTANCE))
{
ActionCastSpellAtObject(SPELL_RESISTANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//invisibilite
if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY) && !GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY))
{
ActionCastSpellAtObject(SPELL_IMPROVED_INVISIBILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_INVISIBILITY_SPHERE) && !GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE))
{
ActionCastSpellAtObject(SPELL_INVISIBILITY_SPHERE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_INVISIBILITY) && !GetHasSpellEffect(SPELL_INVISIBILITY))
{
ActionCastSpellAtObject(SPELL_INVISIBILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Armes magiques
if(GetHasSpell(SPELL_GREATER_MAGIC_WEAPON) && !GetHasSpellEffect(SPELL_GREATER_MAGIC_WEAPON))
{
ActionCastSpellAtObject(SPELL_GREATER_MAGIC_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_DARKFIRE) && !GetHasSpellEffect(SPELL_DARKFIRE))
{
ActionCastSpellAtObject(SPELL_DARKFIRE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MAGIC_WEAPON) && !GetHasSpellEffect(SPELL_MAGIC_WEAPON))
{
ActionCastSpellAtObject(SPELL_MAGIC_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_BLESS_WEAPON) && !GetHasSpellEffect(SPELL_BLESS_WEAPON))
{
ActionCastSpellAtObject(SPELL_BLESS_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_KEEN_EDGE) && !GetHasSpellEffect(SPELL_KEEN_EDGE))
{
ActionCastSpellAtObject(SPELL_KEEN_EDGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//vision
if(GetHasSpell(SPELL_TRUE_SEEING) && !GetHasSpellEffect(SPELL_TRUE_SEEING))
{
ActionCastSpellAtObject(SPELL_TRUE_SEEING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE) && !GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE))
{
ActionCastSpellAtObject(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//DRUIDE
if (bDruid || bRanger)
{
if(GetHasSpell(SPELL_GREATER_MAGIC_FANG))
{
ActionCastSpellAtObject(SPELL_GREATER_MAGIC_FANG, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MAGIC_FANG))
{
ActionCastSpellAtObject(SPELL_MAGIC_FANG, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if (bDruid)
{
if(GetHasSpell(SPELL_AURA_OF_VITALITY)&& !GetHasSpellEffect(SPELL_AURA_OF_VITALITY))
{
ActionCastSpellAtObject(SPELL_AURA_OF_VITALITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_BLOOD_FRENZY)&& !GetHasSpellEffect(SPELL_BLOOD_FRENZY))
{
ActionCastSpellAtObject(SPELL_BLOOD_FRENZY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
}
//MAGES ENSOS BARDES
if (bMage)
{
if(GetHasSpell(SPELL_SHIELD) && !GetHasSpellEffect(SPELL_SHIELD))
{
ActionCastSpellAtObject(SPELL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MAGE_ARMOR) && !GetHasSpellEffect(SPELL_MAGE_ARMOR))
{
ActionCastSpellAtObject(SPELL_MAGE_ARMOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_IRONGUTS) && !GetHasSpellEffect(SPELL_IRONGUTS))
{
ActionCastSpellAtObject(SPELL_IRONGUTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
//PRETRES
if (bCleric)
{
if(GetHasSpell(SPELL_DIVINE_SHIELD) && !GetHasSpellEffect(SPELL_DIVINE_SHIELD))
{
ActionCastSpellAtObject(SPELL_DIVINE_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_DIVINE_POWER) && !GetHasSpellEffect(SPELL_DIVINE_POWER))
{
ActionCastSpellAtObject(SPELL_DIVINE_POWER, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_ENTROPIC_SHIELD) && !GetHasSpellEffect(SPELL_ENTROPIC_SHIELD))
{
ActionCastSpellAtObject(SPELL_ENTROPIC_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MAGIC_VESTMENT) && !GetHasSpellEffect(SPELL_ENTROPIC_SHIELD))
{
ActionCastSpellAtObject(SPELL_MAGIC_VESTMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_UNDEATHS_ETERNAL_FOE) && !GetHasSpellEffect(SPELL_UNDEATHS_ETERNAL_FOE))
{
ActionCastSpellAtObject(SPELL_UNDEATHS_ETERNAL_FOE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
return TRUE;
}
}
}
return FALSE;
}Le code a colorer syntaxiquement est trop long (plus de 10240 caractères) et risque de ne pas s'afficher du tout. Vous pouvez le voir en version colorée ici.
///version modifiee de TalentAdvancedBuff()
///(x0_i0_talent)
///bAllClassSpell :
/// TRUE : le lanceur verifiera s'il possede les sorts de toutes les classes
/// FALSE : (defaut) seulement les sorts ou il possede des niveaux
/// renvoie TRUE si le buff a lieu FALSE sinon
/// Par Sith Vicious
/////////////////////////
#include "x0_inc_generic"
int MyBuff(float fDistance, int bInstant = TRUE, int bAllClassSpell = FALSE)
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if(GetIsObjectValid(oPC))
{
if(GetDistanceToObject(oPC) <= fDistance)
{
//int bPaladin = GetLevelByClass(CLASS_TYPE_PALADIN);
int bMage = bAllClassSpell || GetLevelByClass(CLASS_TYPE_WIZARD) || GetLevelByClass(CLASS_TYPE_SORCERER) || GetLevelByClass(CLASS_TYPE_BARD);
int bDruid = bAllClassSpell || GetLevelByClass(CLASS_TYPE_DRUID);
int bRanger = bAllClassSpell || GetLevelByClass(CLASS_TYPE_RANGER);
int bCleric = bAllClassSpell || GetLevelByClass(CLASS_TYPE_CLERIC);
//int bBard = GetLevelByClass(CLASS_TYPE_BARD);
if (bDruid || bRanger) SummonAnimalCompanion();
if (bMage) SummonFamiliar();
if(!GetIsFighting(OBJECT_SELF))
{
ClearActions(CLEAR_X0_I0_TALENT_AdvancedBuff);
//Combat Protections
if(GetHasSpell(SPELL_PREMONITION) && !GetHasSpellEffect(SPELL_PREMONITION))
{
ActionCastSpellAtObject(SPELL_PREMONITION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GREATER_STONESKIN)&& !GetHasSpellEffect(SPELL_GREATER_STONESKIN))
{
ActionCastSpellAtObject(SPELL_GREATER_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, 0, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_STONESKIN)&& !GetHasSpellEffect(SPELL_STONESKIN))
{
ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BARKSKIN)&& !GetHasSpellEffect(SPELL_BARKSKIN))
{
ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Visage Protections
if(GetHasSpell(SPELL_SHADOW_SHIELD)&& !GetHasSpellEffect(SPELL_SHADOW_SHIELD))
{
ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ETHEREAL_VISAGE)&& !GetHasSpellEffect(SPELL_ETHEREAL_VISAGE))
{
ActionCastSpellAtObject(SPELL_ETHEREAL_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GHOSTLY_VISAGE)&& !GetHasSpellEffect(SPELL_GHOSTLY_VISAGE))
{
ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_DISPLACEMENT)&& !GetHasSpellEffect(SPELL_DISPLACEMENT))
{
ActionCastSpellAtObject(SPELL_DISPLACEMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Mantle Protections
if(GetHasSpell(SPELL_GREATER_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_SPELL_MANTLE)&& !GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE))
{
ActionCastSpellAtObject(SPELL_LESSER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
// Globes
if(GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY)&& !GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY))
{
ActionCastSpellAtObject(SPELL_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY)&& !GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY))
{
ActionCastSpellAtObject(SPELL_MINOR_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Misc Protections
if(GetHasSpell(SPELL_ELEMENTAL_SHIELD)&& !GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD))
{
ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if (GetHasSpell(SPELL_MESTILS_ACID_SHEATH)&& !GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH))
{
ActionCastSpellAtObject(SPELL_MESTILS_ACID_SHEATH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if (GetHasSpell(SPELL_DEATH_ARMOR)&& !GetHasSpellEffect(SPELL_DEATH_ARMOR))
{
ActionCastSpellAtObject(SPELL_DEATH_ARMOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Elemental Protections
if(GetHasSpell(SPELL_ENERGY_BUFFER)&& !GetHasSpellEffect(SPELL_ENERGY_BUFFER))
{
ActionCastSpellAtObject(SPELL_ENERGY_BUFFER, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS)&& !GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_PROTECTION_FROM_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_RESIST_ELEMENTS)&& !GetHasSpellEffect(SPELL_RESIST_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_RESIST_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ENDURE_ELEMENTS)&& !GetHasSpellEffect(SPELL_ENDURE_ELEMENTS))
{
ActionCastSpellAtObject(SPELL_ENDURE_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Mental Protections
if(GetHasSpell(SPELL_MIND_BLANK)&& !GetHasSpellEffect(SPELL_MIND_BLANK))
{
ActionCastSpellAtObject(SPELL_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_MIND_BLANK)&& !GetHasSpellEffect(SPELL_LESSER_MIND_BLANK))
{
ActionCastSpellAtObject(SPELL_LESSER_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CLARITY)&& !GetHasSpellEffect(SPELL_CLARITY))
{
ActionCastSpellAtObject(SPELL_CLARITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Summon Ally
if (GetAssociate(ASSOCIATE_TYPE_SUMMONED)==OBJECT_INVALID)
{
if(GetHasSpell(SPELL_ELEMENTAL_SWARM))
{
ActionCastSpellAtLocation(SPELL_ELEMENTAL_SWARM, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BLACK_BLADE_OF_DISASTER))
{
ActionCastSpellAtLocation(SPELL_BLACK_BLADE_OF_DISASTER, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MORDENKAINENS_SWORD))
{
ActionCastSpellAtLocation(SPELL_MORDENKAINENS_SWORD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_IX))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IX, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_GREATER_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_GREATER_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VIII))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VIII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VII))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_PLANAR_ALLY))
{
ActionCastSpellAtLocation(SPELL_PLANAR_ALLY, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VI))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VI, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_LESSER_PLANAR_BINDING))
{
ActionCastSpellAtLocation(SPELL_LESSER_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_V))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_V, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_IV))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IV, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ANIMATE_DEAD))
{
ActionCastSpellAtLocation(SPELL_ANIMATE_DEAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_III))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_III, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_II))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_II, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_I))
{
ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE))
{
ActionCastSpellAtLocation(SPELL_SHELGARNS_PERSISTENT_BLADE, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
//boost carac
if(GetHasSpell(SPELL_GREATER_BULLS_STRENGTH) && !GetHasSpellEffect(SPELL_GREATER_BULLS_STRENGTH))
{
ActionCastSpellAtObject(SPELL_GREATER_BULLS_STRENGTH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_BULLS_STRENGTH) && !GetHasSpellEffect(SPELL_BULLS_STRENGTH))
{
ActionCastSpellAtObject(SPELL_BULLS_STRENGTH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_EAGLE_SPLENDOR) && !GetHasSpellEffect(SPELL_GREATER_EAGLE_SPLENDOR))
{
ActionCastSpellAtObject(SPELL_GREATER_EAGLE_SPLENDOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_EAGLE_SPLEDOR) && !GetHasSpellEffect(SPELL_EAGLE_SPLEDOR))
{
ActionCastSpellAtObject(SPELL_EAGLE_SPLEDOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_CATS_GRACE) && !GetHasSpellEffect(SPELL_GREATER_CATS_GRACE))
{
ActionCastSpellAtObject(SPELL_GREATER_CATS_GRACE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CATS_GRACE) && !GetHasSpellEffect(SPELL_CATS_GRACE))
{
ActionCastSpellAtObject(SPELL_CATS_GRACE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_FOXS_CUNNING) && !GetHasSpellEffect(SPELL_GREATER_FOXS_CUNNING))
{
ActionCastSpellAtObject(SPELL_GREATER_FOXS_CUNNING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_FOXS_CUNNING) && !GetHasSpellEffect(SPELL_FOXS_CUNNING))
{
ActionCastSpellAtObject(SPELL_FOXS_CUNNING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_OWLS_WISDOM) && !GetHasSpellEffect(SPELL_GREATER_OWLS_WISDOM))
{
ActionCastSpellAtObject(SPELL_GREATER_OWLS_WISDOM, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_OWLS_WISDOM) && !GetHasSpellEffect(SPELL_OWLS_WISDOM))
{
ActionCastSpellAtObject(SPELL_OWLS_WISDOM, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_GREATER_ENDURANCE) && !GetHasSpellEffect(SPELL_GREATER_ENDURANCE))
{
ActionCastSpellAtObject(SPELL_GREATER_ENDURANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_ENDURANCE) && !GetHasSpellEffect(SPELL_ENDURANCE))
{
ActionCastSpellAtObject(SPELL_ENDURANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Autres protections
if(GetHasSpell(SPELL_DEATH_WARD) && !GetHasSpellEffect(SPELL_DEATH_WARD))
{
ActionCastSpellAtObject(SPELL_DEATH_WARD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT) && !GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT))
{
ActionCastSpellAtObject(SPELL_FREEDOM_OF_MOVEMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION) && !GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION))
{
ActionCastSpellAtObject(SPELL_NEGATIVE_ENERGY_PROTECTION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_PROTECTION_FROM_SPELLS) && !GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS))
{
ActionCastSpellAtObject(SPELL_PROTECTION_FROM_SPELLS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_SHIELD_OF_FAITH) && !GetHasSpellEffect(SPELL_SHIELD_OF_FAITH))
{
ActionCastSpellAtObject(SPELL_SHIELD_OF_FAITH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_SPELL_RESISTANCE) && !GetHasSpellEffect(SPELL_SPELL_RESISTANCE))
{
ActionCastSpellAtObject(SPELL_SPELL_RESISTANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Autres boost
if(GetHasSpell(SPELL_BLESS) && !GetHasSpellEffect(SPELL_BLESS))
{
ActionCastSpellAtObject(SPELL_BLESS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_AID) && !GetHasSpellEffect(SPELL_AID))
{
ActionCastSpellAtObject(SPELL_AID, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MASS_HASTE) && !GetHasSpellEffect(SPELL_MASS_HASTE))
{
ActionCastSpellAtObject(SPELL_MASS_HASTE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_HASTE) && !GetHasSpellEffect(SPELL_HASTE))
{
ActionCastSpellAtObject(SPELL_HASTE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_RESISTANCE) && !GetHasSpellEffect(SPELL_RESISTANCE))
{
ActionCastSpellAtObject(SPELL_RESISTANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//invisibilite
if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY) && !GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY))
{
ActionCastSpellAtObject(SPELL_IMPROVED_INVISIBILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_INVISIBILITY_SPHERE) && !GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE))
{
ActionCastSpellAtObject(SPELL_INVISIBILITY_SPHERE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_INVISIBILITY) && !GetHasSpellEffect(SPELL_INVISIBILITY))
{
ActionCastSpellAtObject(SPELL_INVISIBILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//Armes magiques
if(GetHasSpell(SPELL_GREATER_MAGIC_WEAPON) && !GetHasSpellEffect(SPELL_GREATER_MAGIC_WEAPON))
{
ActionCastSpellAtObject(SPELL_GREATER_MAGIC_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_DARKFIRE) && !GetHasSpellEffect(SPELL_DARKFIRE))
{
ActionCastSpellAtObject(SPELL_DARKFIRE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MAGIC_WEAPON) && !GetHasSpellEffect(SPELL_MAGIC_WEAPON))
{
ActionCastSpellAtObject(SPELL_MAGIC_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_BLESS_WEAPON) && !GetHasSpellEffect(SPELL_BLESS_WEAPON))
{
ActionCastSpellAtObject(SPELL_BLESS_WEAPON, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_KEEN_EDGE) && !GetHasSpellEffect(SPELL_KEEN_EDGE))
{
ActionCastSpellAtObject(SPELL_KEEN_EDGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//vision
if(GetHasSpell(SPELL_TRUE_SEEING) && !GetHasSpellEffect(SPELL_TRUE_SEEING))
{
ActionCastSpellAtObject(SPELL_TRUE_SEEING, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE) && !GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE))
{
ActionCastSpellAtObject(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
//DRUIDE
if (bDruid || bRanger)
{
if(GetHasSpell(SPELL_GREATER_MAGIC_FANG))
{
ActionCastSpellAtObject(SPELL_GREATER_MAGIC_FANG, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
else if(GetHasSpell(SPELL_MAGIC_FANG))
{
ActionCastSpellAtObject(SPELL_MAGIC_FANG, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if (bDruid)
{
if(GetHasSpell(SPELL_AURA_OF_VITALITY)&& !GetHasSpellEffect(SPELL_AURA_OF_VITALITY))
{
ActionCastSpellAtObject(SPELL_AURA_OF_VITALITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_BLOOD_FRENZY)&& !GetHasSpellEffect(SPELL_BLOOD_FRENZY))
{
ActionCastSpellAtObject(SPELL_BLOOD_FRENZY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
}
//MAGES ENSOS BARDES
if (bMage)
{
if(GetHasSpell(SPELL_SHIELD) && !GetHasSpellEffect(SPELL_SHIELD))
{
ActionCastSpellAtObject(SPELL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MAGE_ARMOR) && !GetHasSpellEffect(SPELL_MAGE_ARMOR))
{
ActionCastSpellAtObject(SPELL_MAGE_ARMOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_IRONGUTS) && !GetHasSpellEffect(SPELL_IRONGUTS))
{
ActionCastSpellAtObject(SPELL_IRONGUTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
//PRETRES
if (bCleric)
{
if(GetHasSpell(SPELL_DIVINE_SHIELD) && !GetHasSpellEffect(SPELL_DIVINE_SHIELD))
{
ActionCastSpellAtObject(SPELL_DIVINE_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_DIVINE_POWER) && !GetHasSpellEffect(SPELL_DIVINE_POWER))
{
ActionCastSpellAtObject(SPELL_DIVINE_POWER, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_ENTROPIC_SHIELD) && !GetHasSpellEffect(SPELL_ENTROPIC_SHIELD))
{
ActionCastSpellAtObject(SPELL_ENTROPIC_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_MAGIC_VESTMENT) && !GetHasSpellEffect(SPELL_ENTROPIC_SHIELD))
{
ActionCastSpellAtObject(SPELL_MAGIC_VESTMENT, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
if(GetHasSpell(SPELL_UNDEATHS_ETERNAL_FOE) && !GetHasSpellEffect(SPELL_UNDEATHS_ETERNAL_FOE))
{
ActionCastSpellAtObject(SPELL_UNDEATHS_ETERNAL_FOE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, bInstant);
}
}
return TRUE;
}
}
}
return FALSE;
}