mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-11 17:12:25 +00:00
Merge branch 'aa' of github.com:EQEmu/Server into aa
This commit is contained in:
commit
cca7a7899a
@ -1183,12 +1183,12 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
|||||||
|
|
||||||
// Bards can cast instant cast AAs while they are casting another song
|
// Bards can cast instant cast AAs while they are casting another song
|
||||||
if(spells[rank->spell].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) {
|
if(spells[rank->spell].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) {
|
||||||
if(!SpellFinished(rank->spell, entity_list.GetMob(target_id), 10, -1, -1, spells[rank->spell].ResistDiff, false)) {
|
if(!SpellFinished(rank->spell, entity_list.GetMob(target_id), ALTERNATE_ABILITY_SPELL_SLOT, spells[rank->spell].mana, -1, spells[rank->spell].ResistDiff, false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ExpendAlternateAdvancementCharge(ability->id);
|
ExpendAlternateAdvancementCharge(ability->id);
|
||||||
} else {
|
} else {
|
||||||
if(!CastSpell(rank->spell, target_id, USE_ITEM_SPELL_SLOT, -1, -1, 0, -1, rank->spell_type + pTimerAAStart, cooldown, nullptr, rank->id)) {
|
if(!CastSpell(rank->spell, target_id, ALTERNATE_ABILITY_SPELL_SLOT, -1, -1, 0, -1, rank->spell_type + pTimerAAStart, cooldown, nullptr, rank->id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1979,10 +1979,17 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
|
|
||||||
uint32 effectmod = 10;
|
uint32 effectmod = 10;
|
||||||
int effectmodcap = 0;
|
int effectmodcap = 0;
|
||||||
if (RuleB(Character, UseSpellFileSongCap))
|
bool nocap = false;
|
||||||
|
if (RuleB(Character, UseSpellFileSongCap)) {
|
||||||
effectmodcap = spells[spell_id].songcap / 10;
|
effectmodcap = spells[spell_id].songcap / 10;
|
||||||
|
// this looks a bit weird, but easiest way I could think to keep both systems working
|
||||||
|
if (effectmodcap == 0)
|
||||||
|
nocap = true;
|
||||||
else
|
else
|
||||||
|
effectmodcap += 10;
|
||||||
|
} else {
|
||||||
effectmodcap = RuleI(Character, BaseInstrumentSoftCap);
|
effectmodcap = RuleI(Character, BaseInstrumentSoftCap);
|
||||||
|
}
|
||||||
// this should never use spell modifiers...
|
// this should never use spell modifiers...
|
||||||
// if a spell grants better modifers, they are copied into the item mods
|
// if a spell grants better modifers, they are copied into the item mods
|
||||||
// because the spells are supposed to act just like having the intrument.
|
// because the spells are supposed to act just like having the intrument.
|
||||||
@ -2056,7 +2063,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap;
|
effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap;
|
||||||
if (effectmod < 10)
|
if (effectmod < 10)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
if (effectmodcap && effectmod > effectmodcap) // if the cap is calculated to be 0 using new rules, no cap.
|
if (!nocap && effectmod > effectmodcap) // if the cap is calculated to be 0 using new rules, no cap.
|
||||||
effectmod = effectmodcap;
|
effectmod = effectmodcap;
|
||||||
Log.Out(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id,
|
Log.Out(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id,
|
||||||
effectmod, effectmodcap);
|
effectmod, effectmodcap);
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#define TARGET_RING_SPELL_SLOT 12
|
#define TARGET_RING_SPELL_SLOT 12
|
||||||
#define DISCIPLINE_SPELL_SLOT 10
|
#define DISCIPLINE_SPELL_SLOT 10
|
||||||
#define ABILITY_SPELL_SLOT 9
|
#define ABILITY_SPELL_SLOT 9
|
||||||
|
#define ALTERNATE_ABILITY_SPELL_SLOT 0xFF
|
||||||
|
|
||||||
//LOS Parameters:
|
//LOS Parameters:
|
||||||
#define HEAD_POSITION 0.9f //ratio of GetSize() where NPCs see from
|
#define HEAD_POSITION 0.9f //ratio of GetSize() where NPCs see from
|
||||||
|
|||||||
@ -409,24 +409,19 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
|
|||||||
// ok now we know the target
|
// ok now we know the target
|
||||||
casting_spell_targetid = target_id;
|
casting_spell_targetid = target_id;
|
||||||
|
|
||||||
if (mana_cost == -1) {
|
// We don't get actual mana cost here, that's done when we consume the mana
|
||||||
|
if (mana_cost == -1)
|
||||||
mana_cost = spell.mana;
|
mana_cost = spell.mana;
|
||||||
mana_cost = GetActSpellCost(spell_id, mana_cost);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(HasMGB() && spells[spell_id].can_mgb)
|
|
||||||
mana_cost *= 2;
|
|
||||||
|
|
||||||
// mana is checked for clients on the frontend. we need to recheck it for NPCs though
|
// mana is checked for clients on the frontend. we need to recheck it for NPCs though
|
||||||
// fix: items dont need mana :-/
|
|
||||||
// If you're at full mana, let it cast even if you dont have enough mana
|
// If you're at full mana, let it cast even if you dont have enough mana
|
||||||
|
|
||||||
// we calculated this above, now enforce it
|
// we calculated this above, now enforce it
|
||||||
if(mana_cost > 0 && slot != 10)
|
if(mana_cost > 0 && slot != USE_ITEM_SPELL_SLOT)
|
||||||
{
|
{
|
||||||
int my_curmana = GetMana();
|
int my_curmana = GetMana();
|
||||||
int my_maxmana = GetMaxMana();
|
int my_maxmana = GetMaxMana();
|
||||||
if(my_curmana < spell.mana) // not enough mana
|
if(my_curmana < mana_cost) // not enough mana
|
||||||
{
|
{
|
||||||
//this is a special case for NPCs with no mana...
|
//this is a special case for NPCs with no mana...
|
||||||
if(IsNPC() && my_curmana == my_maxmana)
|
if(IsNPC() && my_curmana == my_maxmana)
|
||||||
@ -2157,11 +2152,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
}
|
}
|
||||||
#endif //BOTS
|
#endif //BOTS
|
||||||
|
|
||||||
|
// We hold off turning MBG off so we can still use it to calc the mana cost
|
||||||
if(spells[spell_id].can_mgb && HasMGB())
|
if(spells[spell_id].can_mgb && HasMGB())
|
||||||
{
|
{
|
||||||
SpellOnTarget(spell_id, this);
|
SpellOnTarget(spell_id, this);
|
||||||
entity_list.MassGroupBuff(this, this, spell_id, true);
|
entity_list.MassGroupBuff(this, this, spell_id, true);
|
||||||
SetMGB(false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2262,14 +2257,22 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if this was a spell slot or an ability use up the mana for it
|
// if this was a spell slot or an ability use up the mana for it
|
||||||
// CastSpell already reduced the cost for it if we're a client with focus
|
|
||||||
if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0)
|
if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0)
|
||||||
{
|
{
|
||||||
|
mana_used = GetActSpellCost(spell_id, mana_used);
|
||||||
|
if (HasMGB() && spells[spell_id].can_mgb) {
|
||||||
|
mana_used *= 2;
|
||||||
|
SetMGB(false);
|
||||||
|
}
|
||||||
|
// clamp if we some how got focused above our current mana
|
||||||
|
if (GetMana() < mana_used)
|
||||||
|
mana_used = GetMana();
|
||||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d: consuming %d mana", spell_id, mana_used);
|
Log.Out(Logs::Detail, Logs::Spells, "Spell %d: consuming %d mana", spell_id, mana_used);
|
||||||
if (!DoHPToManaCovert(mana_used))
|
if (!DoHPToManaCovert(mana_used)) {
|
||||||
SetMana(GetMana() - mana_used);
|
SetMana(GetMana() - mana_used);
|
||||||
TryTriggerOnValueAmount(false, true);
|
TryTriggerOnValueAmount(false, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//set our reuse timer on long ass reuse_time spells...
|
//set our reuse timer on long ass reuse_time spells...
|
||||||
if(IsClient() && !isproc)
|
if(IsClient() && !isproc)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user