View Single Post
  #4  
Old 10-08-2010, 07:18 AM
Hargael
Fire Beetle
 
Join Date: Aug 2010
Location: France
Posts: 5
Default

Thanks for the comment, if this can help improve the system ...

Here are some news, it works MUCH better !

- Cleric bot : I was right, some spells are missing in the table. In fact, there is no direct heal. The function GetBestBotSpellForRegularSingleTargetHeal is looking for direct heals (type SE_CurrentHP). In the npc_spells_entries table, we can find Complete Healing, some HoT like Celestial Healing, but no big direct heal like Divine Light. So I used Lucy and added this one in the table (it's in the range of level where I am actually, around 55). I added it the same way I added the mez spells (cleric bot spell list 701, spell type 2).

I also have a question about a property of spell struct : priority. How does it work ? I put 1 for the different spells I added, but not sure it's correct. Maybe someone could complete the table more precisely ...

- Enchanter bot : my bot has mez spells, but almost never cast them, and now I know why. I found a bug in the range calculation : in the GetFirstIncomingMobToMez function (botspellsai.cpp), we search for a mob to mez, and compare the distance between the bot and each mob to the spell range. Of course we use the Pythagore theorem, but the test is wrong (mobs are always too far). I changed this :
Code:
if(npc->DistNoRootNoZ(*botCaster) <= spells[botSpell.SpellId].range) {
by this :
Code:
if(npc->DistNoRootNoZ(*botCaster) <= spells[botSpell.SpellId].range * spells[botSpell.SpellId].range) {
and it works !

Next time I will disable automatic runes. I don't want to delete them from the table, so I have to find another way. Maybe priority or a new SpellType ...

EDIT : the DistNoRootNoZ function is often used, maybe we should check all tests done with it ...
Reply With Quote