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.
Adding Weakness !! To mobs
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Adding Weakness !! To mobs
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
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
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Adding Weakness !! To mobs
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)
- IncognitoEel
- Posts: 5
- Joined: Thu Jan 21, 2016 9:26 am
Re: Adding Weakness !! To mobs
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?
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Adding Weakness !! To mobs
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.
Code: Select all
mob:Weakness type(blue):
Re: Adding Weakness !! To mobs
0/1/2/3
Re: Adding Weakness !! To mobs
If being retail like, on engage, not on spawn. if you lose claim on a mob on retail the weakness rerolls.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
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: Adding Weakness !! To mobs
yeah sorry, I remember writing spawn, realising that, backspacing it to write engage, but it seems I wrote spawn again