Welcome to the Builder Academy

Question determining the value of a flag

More
23 Nov 2018 01:50 #8241 by Nexix
I want to have a trigger do something special when it encounters the undead. I have the trigger correct, but can't get it to fire, because my mud doesn't use the race in the OLC, but a race flag.
I can't if %mob.race% == undead , because the race is other. I have tried several things but hitting a wall. ideas?

I have a stat report of an example creature below. I tried to add the bold myself to emphasize what I meant.

neutral MOB 'a Vampire' IDNum: [59132], In room [47501], Loadroom : [65535]
Alias: vampire, VNum: [47501], RNum: [ 2610]
Title: <None>
L-Des: An ancient vampire lurks in the shadows around you.
Monster Class: Warrior, Race: Other, Lev: [22], XP: [ 6554], Align: [ 0]
RACE flags: Undead
Str: [15] Int: [15] Wis: [15] Dex: [15] Con: [15] Cha: [15]
Hit p.:[1200/1200+22] Mana p.:[10/10+22] Move p.:[50/50+22]
Coins: [ 30000], Bank: [ 0] (Total: 30000)
AC: [30], Hitroll: [50], Damroll: [20], Saving throws: [2/4/4/4/5]
Pos: Standing, Fighting: Nobody, Attack type: bite, Default position: Standing
NPC flags: ISNPC STAY-ZONE MEMORY 2nd_ATT
Mob Spec-Proc: None, NPC Bare Hand Dam: 5d5
Carried: weight: 0, items: 0; Items in: inventory: 0, eq: 0
Master is: <none>, Followers are: <none>
AFF: 80040002
AFF: INVIS SNEAK FLY
Script information:
None.

Please Log in or Create an account to join the conversation.

More
25 Nov 2018 10:52 #8243 by WhiskyTest
I think the easiest solution would be to add undead as a separate race, so they aren't using RACE_OTHER. Of course you'd spend a lot of time updating all existing mobs..

To have a trigger recognize race flags would require extending the trigger code to be able to reference them.
You'd be looking at dg_variables.c in void find_replacement() to get started. It's probably a bit more involved than adding a new race though!

A final approach occurs as I'm writing this: make undead an AFF flag. That is super quick to add, and the trigger code already allows checks to see if these are set. You'd do it the same as checking for if a mob was affected with FLY for example.

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds