...Then you're in for a treat.
luahyparc private pastebin - collaborative debugging tool
Requires Arcscripts r1028+
Mudkip PvP AI Companion
This script is a scripted item that summons a Mudkip NPC that follows the owner around like a guardian. This Mudkip is no ordinary mudkip. He takes on the role of an arena partner, imitating a PvP player. When in combat, he is a devastating force, when out of combat, he is a funny, fun-loving sidekick. It's AI is based on a prioritised "state" system; where the mudkip picks his state based on the environment. He has 5 state to choose from: non combat, regular combat, owner in danger, self in trouble, and self critical. He does different things in each state.
Non combat: Just follows you around and has 10 unique and funny chat messages that trigger roughly every 10 min.
Combat: This is his usual combat mode. He attacks using Frost shock, Frostbolt and Waterbolt depending on whether he has enough mana to cast them and if they are on cooldown. There is a rare chance that he may do something special instead of those regular spells.
Owner in danger: He performs a combo involving charging the enemy, sling mud (reducing hit chance) the enemy and healing the player.
Self in trouble: This is when the Mudkip is hindered in some way, he attempts to get out of his trouble via Trinket, Escape Artist or Ice block.
Self critical: The kip will activate his speed booster, run away from enemies and heal himself; he will also try to Ice block to protect himself if he's really in trouble.
Ending notes
That was just a summary of the script, what lies beneath is a hand-made spell casting and cooldown system, as well as extensive table use. Please ask any questions about the script here if I comments don't explain enough. I hope this can be fun as well as a learning opportunity. It's not 100% tested, but I tested the important things such as state transition and critical shared functions.
luahyparc private pastebin - collaborative debugging tool
Recommended SQL
ITEM
NPC
ScreenshotsCode:insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `killcredit1`, `killcredit2`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `leader`) values ('133760', "Frenzied Mudkip", "", '', '0', '1', '0', '0', '0', '0', '25157', '0', '0', '0', '1', '1', '0'); insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`, `summonguard`) values ('133760', '80', '80', '7', '23400', '23400', '43200', '1', '0', '1500', '0', '100', '200', '0', '0', '0', '0', '0', '2555', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0', '0');
![]()