Question about immunities.

Joined
Feb 11, 2008
Messages
1
Reaction score
0
I'm just starting to create new npcs and I was wondering how you go about creating mobs that are immune to fear/stun/cc. I didn't see anything about that specifically and I'm sure there's a way to do it.

I was also wondering if there was a way to make a player immune in the same fashion. Thanks.
 
Code:
MECHANIC_CHARM            = 1,
    MECHANIC_CONFUSED         = 2,
    MECHANIC_DISARM           = 3,
    MECHANIC_DISTRACT         = 4,
    MECHANIC_FEAR             = 5,
    MECHANIC_FUMBLE           = 6,
    MECHANIC_ROOT             = 7,
    MECHANIC_PACIFY           = 8,                          //0 spells use this mechanic
    MECHANIC_SILENCE          = 9,
    MECHANIC_SLEEP            = 10,
    MECHANIC_SNARE            = 11,
    MECHANIC_STUN             = 12,
    MECHANIC_FREEZE           = 13,
    MECHANIC_KNOCKOUT         = 14,
    MECHANIC_BLEED            = 15,
    MECHANIC_BANDAGE          = 16,
    MECHANIC_POLYMORPH        = 17,
    MECHANIC_BANISH           = 18,
    MECHANIC_SHIELD           = 19,
    MECHANIC_SHACKLE          = 20,
    MECHANIC_MOUNT            = 21,
    MECHANIC_PERSUADE         = 22,                         //0 spells use this mechanic
    MECHANIC_TURN             = 23,
    MECHANIC_HORROR           = 24,
    MECHANIC_INVULNERABILITY  = 25,
    MECHANIC_INTERRUPT        = 26,
    MECHANIC_DAZE             = 27,
    MECHANIC_DISCOVERY        = 28

this is mechanic masks.

so, number 0x4CB3F5B in the binary code is

Code:
27   0  - 4
26   1 
25   0
24   0

23   1 - C
22   1
21   0
20   0 

19   1 - B
18   0
17   1
16   1

15   0 - 3
14   0
13   1
12   1

11   1 - F
10   1
9    1
8    1 

7    0 - 5
6    1
5    0
4    1

3    1 - B
2    0
1    1
0    1

we take number from mechanic list decrease by 1 this number is position in binary code, and paste 1 to the code if we want to put immunity else 0.

After we take calculator with binary mode and enter sequence from 27 to 0. at the end we convert in the calculator to decimal or hexadecimal mode.

after we take decimal/hexadecimal number and put to mechanic_immune_mask field in creature_template table.
thnks to jeniar
 
Back