RangerDown
07-08-2004, 03:03 PM
I was trying to put in Vox's breath (Frosty Death, spell#952 -- or Frosty Death2, spell#1356), and the breath never would go off. After turning spell debugging on I saw what was happening: the entry in spells_us.txt had a range of 0. I assume most if not all of the PBAE spells have a range of 0 since range isn't applicable with a pbae. I was able to get the breath to go off only if I /summoned her on top of me.
I made this change to the MobAI.cpp file so that if the spell is targettype 4 (pbae) then the distance check doesn't have to pass:
The change is in line 84 of zone/MobAI.cpp. (As of the 6/21/04 release it's on line 84 -- dunno if that's the case in later CVS's)
Change from:
dist <= spells[AIspells[i].spellid].range
to:
(dist <= spells[AIspells[i].spellid].range || spells[AIspells[i].spellid].targettype == 4)
If you wanna change the debug messages so they now accurately show the new logic:
Line 92, add this to the end of the line:
<< "||targettype[" << spells[AIspells[i].spellid].targettype << "]==4"
and change line 206 to read:
cout << "Mob::AICastSpell: NotCasting: spellid=" << AIspells[i].spellid << ", tar=" << tar->GetName() << ",tar=" << tar->GetName() << ", dist[" << dist << "]<=" << spells[AIspells[i].spellid].range << "||targettype[" << spells[AIspells[i].spellid].targettype << "]==4" << ", mana_cost[" << mana_cost << "]<=" << GetMana() << ", cancast[" << AIspells[i].time_cancast << "]<=" << Timer::GetCurrentTime() << endl;
(Damn that's a long line :P)
After that, Vox started AE'ing quite nicely... much to the dismay of cocky young adventurers everywhere :lol:
I made this change to the MobAI.cpp file so that if the spell is targettype 4 (pbae) then the distance check doesn't have to pass:
The change is in line 84 of zone/MobAI.cpp. (As of the 6/21/04 release it's on line 84 -- dunno if that's the case in later CVS's)
Change from:
dist <= spells[AIspells[i].spellid].range
to:
(dist <= spells[AIspells[i].spellid].range || spells[AIspells[i].spellid].targettype == 4)
If you wanna change the debug messages so they now accurately show the new logic:
Line 92, add this to the end of the line:
<< "||targettype[" << spells[AIspells[i].spellid].targettype << "]==4"
and change line 206 to read:
cout << "Mob::AICastSpell: NotCasting: spellid=" << AIspells[i].spellid << ", tar=" << tar->GetName() << ",tar=" << tar->GetName() << ", dist[" << dist << "]<=" << spells[AIspells[i].spellid].range << "||targettype[" << spells[AIspells[i].spellid].targettype << "]==4" << ", mana_cost[" << mana_cost << "]<=" << GetMana() << ", cancast[" << AIspells[i].time_cancast << "]<=" << Timer::GetCurrentTime() << endl;
(Damn that's a long line :P)
After that, Vox started AE'ing quite nicely... much to the dismay of cocky young adventurers everywhere :lol: