Removing old code, need to reimplement warcry and rampage still at least

This commit is contained in:
KimLS 2015-06-16 12:33:14 -07:00
parent 1b088b7157
commit d3280c9676
8 changed files with 65 additions and 141 deletions

View File

@ -440,48 +440,6 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
target->AddToHateList(this, 1, 0); target->AddToHateList(this, 1, 0);
} }
//turn on an AA effect
//duration == 0 means no time limit, used for one-shot deals, etc..
void Client::EnableAAEffect(aaEffectType type, uint32 duration) {
if(type > _maxaaEffectType)
return; //for now, special logic needed.
m_epp.aa_effects |= 1 << (type-1);
if(duration > 0) {
p_timers.Start(pTimerAAEffectStart + type, duration);
} else {
p_timers.Clear(&database, pTimerAAEffectStart + type);
}
}
void Client::DisableAAEffect(aaEffectType type) {
if(type > _maxaaEffectType)
return; //for now, special logic needed.
uint32 bit = 1 << (type-1);
if(m_epp.aa_effects & bit) {
m_epp.aa_effects ^= bit;
}
p_timers.Clear(&database, pTimerAAEffectStart + type);
}
/*
By default an AA effect is a one shot deal, unless
a duration timer is set.
*/
bool Client::CheckAAEffect(aaEffectType type) {
if(type > _maxaaEffectType)
return(false); //for now, special logic needed.
if(m_epp.aa_effects & (1 << (type-1))) { //is effect enabled?
//has our timer expired?
if(p_timers.Expired(&database, pTimerAAEffectStart + type)) {
DisableAAEffect(type);
return(false);
}
return(true);
}
return(false);
}
void Client::ResetAA() { void Client::ResetAA() {
RefundAA(); RefundAA();
uint32 i; uint32 i;
@ -788,14 +746,6 @@ void Client::InspectBuffs(Client* Inspector, int Rank)
Inspector->FastQueuePacket(&outapp); Inspector->FastQueuePacket(&outapp);
} }
void Client::DurationRampage(uint32 duration)
{
if(duration) {
m_epp.aa_effects |= 1 << (aaEffectRampage-1);
p_timers.Start(pTimerAAEffectStart + aaEffectRampage, duration);
}
}
void Client::RefundAA() { void Client::RefundAA() {
int refunded = 0; int refunded = 0;
@ -933,7 +883,6 @@ void Client::SendAlternateAdvancementRank(int aa_id, int level) {
void Client::SendAlternateAdvancementStats() { void Client::SendAlternateAdvancementStats() {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_AAExpUpdate, sizeof(AltAdvStats_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_AAExpUpdate, sizeof(AltAdvStats_Struct));
AltAdvStats_Struct *aps = (AltAdvStats_Struct *)outapp->pBuffer; AltAdvStats_Struct *aps = (AltAdvStats_Struct *)outapp->pBuffer;
aps->experience = m_pp.expAA;
aps->experience = (uint32)(((float)330.0f * (float)m_pp.expAA) / (float)max_AAXP); aps->experience = (uint32)(((float)330.0f * (float)m_pp.expAA) / (float)max_AAXP);
aps->unspent = m_pp.aapoints; aps->unspent = m_pp.aapoints;
aps->percentage = m_epp.perAA; aps->percentage = m_epp.perAA;

View File

@ -23,21 +23,6 @@ typedef enum {
aaActionFadingMemories = 16 aaActionFadingMemories = 16
} aaNonspellAction; } aaNonspellAction;
//use these for AAs which dont cast spells, yet need effects
//if this list grows beyond 32, more work is needed in *AAEffect
typedef enum { //AA Effect IDs
aaEffectMassGroupBuff = 1, //unused - Handled via spell effect.
aaEffectRampage,
aaEffectSharedHealth,
aaEffectFlamingArrows,
aaEffectFrostArrows,
aaEffectWarcry,
aaEffectLeechTouch,
aaEffectProjectIllusion, // unused - Handled via spell effect
_maxaaEffectType = 32
} aaEffectType;
enum { //leadership AA indexes enum { //leadership AA indexes
groupAAMarkNPC = 0, groupAAMarkNPC = 0,
groupAANPCHealth, groupAANPCHealth,

View File

@ -3519,14 +3519,6 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
if(damage > 0) { if(damage > 0) {
//if there is some damage being done and theres an attacker involved //if there is some damage being done and theres an attacker involved
if(attacker) { if(attacker) {
if(spell_id == SPELL_HARM_TOUCH2 && attacker->IsClient() && attacker->CastToClient()->CheckAAEffect(aaEffectLeechTouch)){
int healed = damage;
healed = attacker->GetActSpellHealing(spell_id, healed);
attacker->HealDamage(healed);
entity_list.MessageClose(this, true, 300, MT_Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName() );
attacker->CastToClient()->DisableAAEffect(aaEffectLeechTouch);
}
// if spell is lifetap add hp to the caster // if spell is lifetap add hp to the caster
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell( spell_id )) { if (spell_id != SPELL_UNKNOWN && IsLifetapSpell( spell_id )) {
int healed = damage; int healed = damage;

View File

@ -541,7 +541,6 @@ public:
bool Flurry(); bool Flurry();
bool Rampage(); bool Rampage();
void DurationRampage(uint32 duration);
inline uint32 GetEXP() const { return m_pp.exp; } inline uint32 GetEXP() const { return m_pp.exp; }
@ -784,13 +783,7 @@ public:
int16 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id); int16 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
void SetAATitle(const char *Title); void SetAATitle(const char *Title);
void SetTitleSuffix(const char *txt); void SetTitleSuffix(const char *txt);
void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing);
//old AA Methods that are slated for removal
void MemorizeSpell(uint32 slot,uint32 spellid,uint32 scribing);
void EnableAAEffect(aaEffectType type, uint32 duration = 0);
void DisableAAEffect(aaEffectType type);
bool CheckAAEffect(aaEffectType type);
int32 acmod(); int32 acmod();
// Item methods // Item methods

View File

@ -391,12 +391,13 @@ bool Client::Process() {
} }
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
{ {
if(CheckAAEffect(aaEffectRampage)) //old aa
{ //if(CheckAAEffect(aaEffectRampage))
entity_list.AEAttack(this, 30); //{
} else { // entity_list.AEAttack(this, 30);
//} else {
Attack(auto_attack_target, MainPrimary); // Kaiyodo - added attacking hand to arguments Attack(auto_attack_target, MainPrimary); // Kaiyodo - added attacking hand to arguments
} //}
ItemInst *wpn = GetInv().GetItem(MainPrimary); ItemInst *wpn = GetInv().GetItem(MainPrimary);
TryWeaponProc(wpn, auto_attack_target, MainPrimary); TryWeaponProc(wpn, auto_attack_target, MainPrimary);
@ -406,11 +407,11 @@ bool Client::Process() {
CheckIncreaseSkill(SkillDoubleAttack, auto_attack_target, -10); CheckIncreaseSkill(SkillDoubleAttack, auto_attack_target, -10);
if(CheckDoubleAttack()) { if(CheckDoubleAttack()) {
//should we allow rampage on double attack? //should we allow rampage on double attack?
if(CheckAAEffect(aaEffectRampage)) { //if(CheckAAEffect(aaEffectRampage)) {
entity_list.AEAttack(this, 30); // entity_list.AEAttack(this, 30);
} else { //} else {
Attack(auto_attack_target, MainPrimary, false); Attack(auto_attack_target, MainPrimary, false);
} //}
} }
//triple attack: rangers, monks, warriors, berserkers over level 60 //triple attack: rangers, monks, warriors, berserkers over level 60
@ -499,21 +500,21 @@ bool Client::Process() {
float random = zone->random.Real(0, 1); float random = zone->random.Real(0, 1);
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10); CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
if (random < DualWieldProbability){ // Max 78% of DW if (random < DualWieldProbability){ // Max 78% of DW
if(CheckAAEffect(aaEffectRampage)) { //if(CheckAAEffect(aaEffectRampage)) {
entity_list.AEAttack(this, 30, MainSecondary); // entity_list.AEAttack(this, 30, MainSecondary);
} else { //} else {
Attack(auto_attack_target, MainSecondary); // Single attack with offhand Attack(auto_attack_target, MainSecondary); // Single attack with offhand
} //}
ItemInst *wpn = GetInv().GetItem(MainSecondary); ItemInst *wpn = GetInv().GetItem(MainSecondary);
TryWeaponProc(wpn, auto_attack_target, MainSecondary); TryWeaponProc(wpn, auto_attack_target, MainSecondary);
if( CanThisClassDoubleAttack() && CheckDoubleAttack()) { if( CanThisClassDoubleAttack() && CheckDoubleAttack()) {
if(CheckAAEffect(aaEffectRampage)) { //if(CheckAAEffect(aaEffectRampage)) {
entity_list.AEAttack(this, 30, MainSecondary); // entity_list.AEAttack(this, 30, MainSecondary);
} else { //} else {
if(auto_attack_target && auto_attack_target->GetHP() > -10) // if(auto_attack_target && auto_attack_target->GetHP() > -10)
Attack(auto_attack_target, MainSecondary); // Single attack with offhand Attack(auto_attack_target, MainSecondary); // Single attack with offhand
} //}
} }
} }
} }

View File

@ -5555,13 +5555,20 @@ void command_setaapts(Client *c, const Seperator *sep)
else if(atoi(sep->arg[2]) <= 0 || atoi(sep->arg[2]) > 200) else if(atoi(sep->arg[2]) <= 0 || atoi(sep->arg[2]) > 200)
c->Message(0, "You must have a number greater than 0 for points and no more than 200."); c->Message(0, "You must have a number greater than 0 for points and no more than 200.");
else if(!strcasecmp(sep->arg[1], "group")) { else if(!strcasecmp(sep->arg[1], "group")) {
t->SetLeadershipEXP(atoi(sep->arg[2])*GROUP_EXP_PER_POINT, t->GetRaidEXP()); t->GetPP().group_leadership_points = atoi(sep->arg[2]);
t->GetPP().group_leadership_exp = 0;
t->Message(MT_Experience, "Setting Group AA points to %u", t->GetPP().group_leadership_points);
t->SendLeadershipEXPUpdate();
} else if(!strcasecmp(sep->arg[1], "raid")) { } else if(!strcasecmp(sep->arg[1], "raid")) {
t->SetLeadershipEXP(t->GetGroupEXP(), atoi(sep->arg[2])*RAID_EXP_PER_POINT); t->GetPP().raid_leadership_points = atoi(sep->arg[2]);
t->GetPP().raid_leadership_exp = 0;
t->Message(MT_Experience, "Setting Raid AA points to %u", t->GetPP().raid_leadership_points);
t->SendLeadershipEXPUpdate();
} else { } else {
t->SetEXP(t->GetEXP(),t->GetMaxAAXP()*atoi(sep->arg[2]),false); t->GetPP().aapoints = atoi(sep->arg[2]);
t->GetPP().expAA = 0;
t->Message(MT_Experience, "Setting personal AA points to %u", t->GetPP().aapoints);
t->SendAlternateAdvancementStats(); t->SendAlternateAdvancementStats();
t->SendAlternateAdvancementTable();
} }
} }

View File

@ -651,27 +651,28 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
group_id_caster = (GetRaid()->GetGroup(CastToClient()) == 0xFFFF) ? 0 : (GetRaid()->GetGroup(CastToClient()) + 1); group_id_caster = (GetRaid()->GetGroup(CastToClient()) == 0xFFFF) ? 0 : (GetRaid()->GetGroup(CastToClient()) + 1);
} }
} }
if(group_id_caster){ //old aa
Group *g = entity_list.GetGroupByID(group_id_caster); //if(group_id_caster){
uint32 time = spell.base[i]*10; // Group *g = entity_list.GetGroupByID(group_id_caster);
if(g){ // uint32 time = spell.base[i]*10;
for(int gi=0; gi < 6; gi++){ // if(g){
if(g->members[gi] && g->members[gi]->IsClient()) // for(int gi=0; gi < 6; gi++){
{ // if(g->members[gi] && g->members[gi]->IsClient())
g->members[gi]->CastToClient()->EnableAAEffect(aaEffectWarcry , time); // {
if (g->members[gi]->GetID() != caster->GetID()) // g->members[gi]->CastToClient()->EnableAAEffect(aaEffectWarcry , time);
g->members[gi]->Message(13, "You hear the war cry."); // if (g->members[gi]->GetID() != caster->GetID())
else // g->members[gi]->Message(13, "You hear the war cry.");
Message(13, "You let loose a fierce war cry."); // else
} // Message(13, "You let loose a fierce war cry.");
} // }
} // }
} // }
//}
else{ //
CastToClient()->EnableAAEffect(aaEffectWarcry , time); //else{
Message(13, "You let loose a fierce war cry."); // CastToClient()->EnableAAEffect(aaEffectWarcry , time);
} // Message(13, "You let loose a fierce war cry.");
//}
break; break;
} }
@ -2232,12 +2233,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_AEMelee: case SE_AEMelee:
{ {
//old aa
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Duration Rampage"); snprintf(effect_desc, _EDLEN, "Duration Rampage");
#endif #endif
if (caster && caster->IsClient()) { // will tidy this up later so that NPCs can duration ramp from spells too //if (caster && caster->IsClient()) { // will tidy this up later so that NPCs can duration ramp from spells too
CastToClient()->DurationRampage(effect_value*12); // CastToClient()->DurationRampage(effect_value*12);
} //}
break; break;
} }
@ -3435,11 +3438,6 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
} }
} }
// Check for non buff spell effects to fade
// AE melee effects
if (IsClient())
CastToClient()->CheckAAEffect(aaEffectRampage);
for (int i = 0; i < EFFECT_COUNT; i++) { for (int i = 0; i < EFFECT_COUNT; i++) {
if (IsBlankSpellEffect(buff.spellid, i)) if (IsBlankSpellEffect(buff.spellid, i))
continue; continue;

View File

@ -4124,14 +4124,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
} }
return true; return true;
} }
//else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) //old aa
else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) //{
{ // Message(13, "Your are immune to fear.");
Message(13, "Your are immune to fear."); // Log.Out(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!");
Log.Out(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!"); // caster->Message_StringID(MT_Shout, IMMUNE_FEAR);
caster->Message_StringID(MT_Shout, IMMUNE_FEAR); // return true;
return true; //}
}
} }
if(IsCharmSpell(spell_id)) if(IsCharmSpell(spell_id))