Adding Weakness !! To mobs

Post Reply
bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

Adding Weakness !! To mobs

Post by bluesolarflare » Tue Feb 02, 2016 9:12 pm

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.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Adding Weakness !! To mobs

Post by kjLotus » Tue Feb 02, 2016 9:23 pm

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

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

Re: Adding Weakness !! To mobs

Post by bluesolarflare » Tue Feb 02, 2016 11:35 pm

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)

User avatar
IncognitoEel
Posts: 5
Joined: Thu Jan 21, 2016 9:26 am

Re: Adding Weakness !! To mobs

Post by IncognitoEel » Wed Feb 03, 2016 12:20 am

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?

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

Re: Adding Weakness !! To mobs

Post by bluesolarflare » Wed Feb 03, 2016 12:46 am

Yea I am trying to add some lines in the lua of certain mobs to trigger that animation. So far I've tried

Code: Select all

mob:Weakness type(blue):
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.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Adding Weakness !! To mobs

Post by kjLotus » Wed Feb 03, 2016 12:52 am

0/1/2/3

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Adding Weakness !! To mobs

Post by TeoTwawki » Sat Feb 06, 2016 7:43 am

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. :)
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Adding Weakness !! To mobs

Post by kjLotus » Sat Feb 06, 2016 3:02 pm

yeah sorry, I remember writing spawn, realising that, backspacing it to write engage, but it seems I wrote spawn again

Post Reply