This commit is contained in:
root 2013-05-12 21:36:13 -05:00
commit 0f880177e4
5 changed files with 82 additions and 9 deletions

View File

@ -1859,7 +1859,7 @@ ENCODE(OP_ZoneSpawns)
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize += 60;
@ -1985,7 +1985,7 @@ ENCODE(OP_ZoneSpawns)
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // unknown18
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0xffffffff); // unknown19
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{

View File

@ -1003,7 +1003,7 @@ ENCODE(OP_ZoneSpawns) {
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::EquipStruct) * 9);
@ -1200,7 +1200,7 @@ ENCODE(OP_ZoneSpawns) {
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@ -1225,7 +1225,7 @@ ENCODE(OP_ZoneSpawns) {
}
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer;

View File

@ -1015,7 +1015,7 @@ ENCODE(OP_ZoneSpawns) {
}
float SpawnSize = emu->size;
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522)))
if(!((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::EquipStruct) * 9);
@ -1212,7 +1212,7 @@ ENCODE(OP_ZoneSpawns) {
Buffer += sizeof(structs::Spawn_Struct_Position);
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for(k = 0; k < 9; ++k)
{
@ -1237,7 +1237,7 @@ ENCODE(OP_ZoneSpawns) {
}
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu ->race == 130) || (emu->race == 330) || (emu->race == 522))
if((emu->NPC == 0) || (emu->race <=12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer;

View File

@ -3745,6 +3745,7 @@ void Bot::AI_Process() {
if(IsBotArcher() && ranged_timer.Check(false)) {
if(GetTarget()->GetHPRatio() <= 99.0f)
// Mob::DoArcheryAttackDmg() takes care of Bot Range and Ammo procs
BotRangedAttack(GetTarget());
}
else if(!IsBotArcher() && (!(IsBotCaster() && GetLevel() > 12)) && GetTarget() && !IsStunned() && !IsMezzed() && (GetAppearance() != eaDead)) {
@ -3763,6 +3764,9 @@ void Bot::AI_Process() {
if(attack_timer.Check()) {
Attack(GetTarget(), SLOT_PRIMARY);
ItemInst *wpn = GetBotItem(SLOT_PRIMARY);
TryWeaponProc(wpn, GetTarget(), SLOT_PRIMARY);
bool tripleSuccess = false;
if(BotOwner && GetTarget() && CanThisClassDoubleAttack()) {
@ -5374,7 +5378,7 @@ std::string Bot::RaceIdToString(uint16 raceId) {
Result = std::string("Iksar");
break;
case 130:
Result == std::string("Vah Shir");
Result = std::string("Vah Shir");
break;
case 330:
Result = std::string("Froglok");
@ -11767,6 +11771,25 @@ void Bot::CalcItemBonuses()
if(itemtmp->Haste != 0)
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
itembonuses.stringedMod += itemtmp->BardValue;
itembonuses.windMod += itemtmp->BardValue;
}
}
if ((itemtmp->Worn.Effect != 0) && (itemtmp->Worn.Type == ET_WornEffect)) { // latent effects
ApplySpellsBonuses(itemtmp->Worn.Effect, itemtmp->Worn.Level, &itembonuses);
}
@ -11832,6 +11855,25 @@ void Bot::CalcItemBonuses()
if(itemtmp->Haste != 0)
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
itembonuses.stringedMod += itemtmp->BardValue;
itembonuses.windMod += itemtmp->BardValue;
}
}
if ((itemtmp->Worn.Effect != 0) && (itemtmp->Worn.Type == ET_WornEffect)) { // latent effects
ApplySpellsBonuses(itemtmp->Worn.Effect, itemtmp->Worn.Level, &itembonuses);
}
@ -11869,6 +11911,10 @@ void Bot::CalcBotStats(bool showtext) {
GetBotOwner()->Message(15, "Base stats:");
GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), base_hp, AC, max_mana, STR, STA, DEX, AGI, INT, WIS, CHA);
GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",MR,PR,FR,CR,DR,Corrup);
// Test Code
if(GetClass() == BARD)
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
GetSkill(BRASS_INSTRUMENTS), GetSkill(PERCUSSION_INSTRUMENTS), GetSkill(SINGING), GetSkill(STRINGED_INSTRUMENTS), GetSkill(WIND_INSTRUMENTS));
}
/*if(this->Save())
@ -11884,6 +11930,16 @@ void Bot::CalcBotStats(bool showtext) {
GetBotOwner()->Message(15, "I'm updated.");
GetBotOwner()->Message(15, "Level: %i HP: %i AC: %i Mana: %i STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetLevel(), max_hp, GetAC(), max_mana, GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
GetBotOwner()->Message(15, "Resists-- Magic: %i, Poison: %i, Fire: %i, Cold: %i, Disease: %i, Corruption: %i.",GetMR(),GetPR(),GetFR(),GetCR(),GetDR(),GetCorrup());
// Test Code
if(GetClass() == BARD) {
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
GetSkill(BRASS_INSTRUMENTS) + GetBrassMod(),
GetSkill(PERCUSSION_INSTRUMENTS) + GetPercMod(),
GetSkill(SINGING) + GetSingMod(),
GetSkill(STRINGED_INSTRUMENTS) + GetStringMod(),
GetSkill(WIND_INSTRUMENTS) + GetWindMod());
GetBotOwner()->Message(15, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod());
}
}
}

View File

@ -706,6 +706,15 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if(!center->CheckLosFN(curmob))
continue;
}
else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// This does not check faction for beneficial AE buffs..only agro and attackable.
// I've tested for spells that I can find without problem, but a faction-based
// check may still be needed. Any changes here should also reflect in BardAEPulse() -U
if(caster->IsAttackAllowed(curmob, true))
continue;
if(caster->CheckAggro(curmob))
continue;
}
//if we get here... cast the spell.
if(IsTargetableAESpell(spell_id) && bad)
@ -812,6 +821,14 @@ void EntityList::AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool aff
if(!center->CheckLosFN(curmob))
continue;
}
else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// See notes in AESpell() above for more info.
if(caster->IsAttackAllowed(curmob, true))
continue;
if(caster->CheckAggro(curmob))
continue;
}
//if we get here... cast the spell.
curmob->BardPulse(spell_id, caster);
}