Thank Jab it's perfect
If spell cast is 50 time a sec, it useless, to mutch check and ressource, and not allow a really customisation.
And maybe it can be very usefull to add some value in npc data, like attack speed.
First actual spawn_npc_spells doesnt contain spell percent field better to be in this table instead of spawn_npc.cast_percentage. A thing like that:
Code: Select all
ALTER TABLE `spawn_npc_spells`
ADD COLUMN `spell_chance_balanced` int NOT NULL AFTER `spell_tier`,
ADD COLUMN `spell_chance_offensive` int NOT NULL AFTER `spell_chance_balanced`,
ADD COLUMN `spell_chance_defensive` int NOT NULL AFTER `spell_chance_offensive`;
I Think we should handle AI with LUA script but we need also some more function with ARRAY (Jab you hate me right ?) list retrive spell list, percent chance...
This allow to set two things, 1 the probability of NPC casting a spell (handle in LUA) 2 The probability of spell choose when casting (handle with DB data in LUA). And 3 :p this allow to script all spell probability ONLY in LUA for complex Raid Boss script.
Assuming NPC Spell list can be call in LUA and Combat AI call LUA script.
In this lua file at Auto_Attack_Tick you do your process for AI (like I have start to do) simple example Generic Warrior AI.
CASE DEFFENSIVE
-- 35 % to caste combat art [ Kick (50 %) or Taunt (50 %) ] (In my example there spell list and percent value are in npc spells table but we can set in script a generic list if there is no spell list in db)
-- 2 % to switch aggro to heal on attackers group, if there is no heal switch on a random member of attackers group
-- 12 % to check if attackers group members 's target is heal of Spawn group, if there is no heal switch on a random member of attackers group who not focus Spawn if all member focus Spawn do nothing
-- 1 % to full wipe aggro (not mean end combat)
-- 50 % to simply auto attack
CASE OFFENSIVE
-- 35 % to caste combat art [ Kick (90 %) or Taunt (10 %) ] (In my example there spell list and percent value are in npc spells table but we can set in script a generic list if there is no spell list in db)
-- 5 % to switch aggro to heal on attackers group, if there is no heal switch on a random member of attackers group
-- 2 % to check if attackers group members 's target is heal of Spawn group, if there is no heal switch on a random member of attackers group who not focus Spawn if all member focus Spawn do nothing
-- 4 % to full wipe aggro (not mean end combat)
-- 50 % to simply auto attack
CASE BALANCED
-- 35 % to caste combat art [ Kick (75 %) or Taunt (25 %) ] (In my example there spell list and percent value are in npc spells table but we can set in script a generic list if there is no spell list in db)
-- 2 % to switch aggro to heal on attackers group, if there is no heal switch on a random member of attackers group
-- 5 % to check if attackers group members 's target is heal of Spawn group, if there is no heal switch on a random member of attackers group who not focus Spawn if all member focus Spawn do nothing
-- 1 % to full wipe aggro (not mean end combat)
-- 57 % to simply auto attack
It for generic, but maybe we need some more like Generic Gnoll Wario AI, this allow to set so combat text specific to gnolls and maybe some other stuff.
And at spawn event do "buff event", here we need to handle NPC buffing, simply store avariables buffs in NPC Buff List table look like NPC spell list (spell and percent chance for each mode Offensive, def..).
-- Enum buff list
-- if < 100 % do rand and cast if needed
-- if >= 100 % cast it
And we need one more stuff for recall a "buff check" this can be done in lua (rand spell probability each time) or in code (rand on time in lua, store NPC buff list and refresh it when needed). Assuming code can call NPC animation, on live, you can see npc cast buff when they are down.
Again that is just my idea, just purpose it

But think there things can be help us to get a living world quickly