Page 1 of 1
Adding Weakness !! To mobs
Posted: Tue Feb 02, 2016 9:12 pm
by bluesolarflare
Looking for some general help on adding Weakness animations to mobs like Abyssea.
I am hoping to do it under certain conditions with if then statements when the mob is engaged.
Re: Adding Weakness !! To mobs
Posted: Tue Feb 02, 2016 9:23 pm
by kjLotus
pick their weaknesses on spawn
have a listener on being hit by a weaponskill/spell
check the weakness in the listener function
use the binding for playing the animation, apply amnesia/silence/terror
Re: Adding Weakness !! To mobs
Posted: Tue Feb 02, 2016 11:35 pm
by bluesolarflare
Sorry I should've been more specific. The problem I am having is triggering the animation. I am using mob:weaknessType but not sure what syntax to use in the parenthesis. I know that it is looking for a number but in the core it shows the weakness types as RED, YELLOW, BLUE, WHITE so I am trying to figure out how to call the animation (1806, 1807, 1808, etc)
Re: Adding Weakness !! To mobs
Posted: Wed Feb 03, 2016 12:20 am
by IncognitoEel
bluesolarflare wrote:Sorry I should've been more specific. The problem I am having is triggering the animation. I am using mob:weaknessType but not sure what syntax to use in the parenthesis. I know that it is looking for a number but in the core it shows the weakness types as RED, YELLOW, BLUE, WHITE so I am trying to figure out how to call the animation (1806, 1807, 1808, etc)
Code: Select all
void WeaknessTrigger(CBaseEntity* PTarget, WeaknessType level)
{
uint16 animationID = 0;
switch (level)
{
case WeaknessType::RED:
animationID = 1806;
break;
case WeaknessType::YELLOW:
animationID = 1807;
break;
case WeaknessType::BLUE:
animationID = 1808;
break;
case WeaknessType::WHITE:
animationID = 1946;
break;
}
action_t action;
action.actiontype = ACTION_MOBABILITY_FINISH;
action.id = PTarget->id;
actionList_t& list = action.getNewActionList();
list.ActionTargetID = PTarget->id;
actionTarget_t& target = list.getNewActionTarget();
target.animation = animationID;
target.param = 2582;
PTarget->loc.zone->PushPacket(PTarget, CHAR_INRANGE, new CActionPacket(action));
}
That's from mobutils.cpp, I think that's what you're looking for?
Re: Adding Weakness !! To mobs
Posted: Wed Feb 03, 2016 12:46 am
by bluesolarflare
Yea I am trying to add some lines in the lua of certain mobs to trigger that animation. So far I've tried
In the hopes of it triggering the animation but it crashes because it debugs if the value is not an integer or is nil. This is where I am having a problem.
Re: Adding Weakness !! To mobs
Posted: Wed Feb 03, 2016 12:52 am
by kjLotus
0/1/2/3
Re: Adding Weakness !! To mobs
Posted: Sat Feb 06, 2016 7:43 am
by TeoTwawki
kjLotus wrote:pick their weaknesses on spawn
have a listener on being hit by a weaponskill/spell
check the weakness in the listener function
use the binding for playing the animation, apply amnesia/silence/terror
If being retail like, on engage, not on spawn. if you lose claim on a mob on retail the weakness rerolls.
Re: Adding Weakness !! To mobs
Posted: Sat Feb 06, 2016 3:02 pm
by kjLotus
yeah sorry, I remember writing spawn, realising that, backspacing it to write engage, but it seems I wrote spawn again