Welcome to the Builder Academy

Question prevent bash - Issue could use help pls

More
29 Dec 2024 15:36 - 29 Dec 2024 19:09 #10495 by JTP
Hi

Im trying to prevent a player from bashing a mob that is a giant, unless you yourself is a giant.

Ok I can bash a mob that is not a giant, and I get the correct message if I try to bash a NPC who is a giant when im not.

But if I try to bash a player who is not half giant, then I still get told that Im not tall enough to bash a giant.

What is wrong ?


  if ((GET_CLASS(vict) == CLASS_NPC_GIANT || GET_RACE(vict) == RACE_HALF_GIANT) && (GET_RACE(ch) != RACE_HALF_GIANT)) {
    send_to_char(ch, "You aren't tall enough to bash a giant!\r\n");
    return;
  }
Last edit: 29 Dec 2024 19:09 by JTP.

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

More
30 Dec 2024 11:29 #10500 by thomas
Your logic looks sound; the parenthesis are matched at the right places. I'd check the values of the fields and compare them to the constants. (add a log where you print out GET_CLASS(vict), GET_RACE(vict) and GET_RACE(ch) to debug)

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

Time to create page: 0.453 seconds