- Posts: 937
- Thank you received: 17
Skill wear off messages
- JTP
- Topic Author
- Offline
- Platinum Member
-
I set an aff type skill_meditate lasting 2 ticks. But when those two ticks are gone. They never know that they no longer meditate.
have anyone made a skill wear off system, and maybe could show how you made it work ?
much appreciated
Also I have this check:
if(affected_by_spell(ch,SKILL_MEDITATE)) {
send_to_char(ch, "Your mind is already meditating, so rest and relax.\n\r");
return;
}
But all I get is: Nah... You feel too relaxed to do that..
any idea why ?
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
About wear_off-messages: they already exist, but for spells. Since skills are a "spell" structure, you could easily expand them with the wear_off_msg:
github.com/tbamud/tbamud/blob/dceb563a9b.../spell_parser.c#L704
-#define skillo(skill, name) spello(skill, name, 0, 0, 0, 0, 0, 0, 0, NULL);
+#define skillo(skill, name, wearoff) spello(skill, name, 0, 0, 0, 0, 0, 0, 0, wearoff);
- skillo(SKILL_BACKSTAB, "backstab");
- skillo(SKILL_BASH, "bash");
- skillo(SKILL_HIDE, "hide");
- skillo(SKILL_KICK, "kick");
- skillo(SKILL_PICK_LOCK, "pick lock");
- skillo(SKILL_RESCUE, "rescue");
- skillo(SKILL_SNEAK, "sneak");
- skillo(SKILL_STEAL, "steal");
- skillo(SKILL_TRACK, "track");
- skillo(SKILL_WHIRLWIND, "whirlwind");
- skillo(SKILL_BANDAGE, "bandage");
- skillo(SKILL_MEDITATE, "meditate");
+ skillo(SKILL_BACKSTAB, "backstab", NULL);
+ skillo(SKILL_BASH, "bash", NULL);
+ skillo(SKILL_HIDE, "hide", NULL);
+ skillo(SKILL_KICK, "kick", NULL);
+ skillo(SKILL_PICK_LOCK, "pick lock", NULL);
+ skillo(SKILL_RESCUE, "rescue", NULL);
+ skillo(SKILL_SNEAK, "sneak", NULL);
+ skillo(SKILL_STEAL, "steal", NULL);
+ skillo(SKILL_TRACK, "track", NULL);
+ skillo(SKILL_WHIRLWIND, "whirlwind", NULL);
+ skillo(SKILL_BANDAGE, "bandage", NULL);
+ skillo(SKILL_MEDITATE, "meditate", "You are no longer meditating.");
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
log("is_affected: %s", affected_by_spell(ch, SKILL_MEDITATE));
And similar
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
+ log("Wearoff: char: %s, af->spell: %d, wear_off_msg: %s", GET_NAME(i), af->spell, spell_info[af->spell].wear_off_msg);
if ((af->spell > 0) && (af->spell <= MAX_SPELLS))
if (!af->next || (af->next->spell != af->spell) ||
(af->next->duration > 0))
if (spell_info[af->spell].wear_off_msg)
send_to_char(i, "%s\r\n", spell_info[af->spell].wear_off_msg);
affect_remove(i, af);
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Apr 28 16:35:41 :: Wearoff: char: Slash, af->spell: 206, wear_off_msg: The red glow fades.
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
Add another log line beneath the one you have added, where you list the status of the different checks (or use gdb to debug, there's a description of how, somewhere around here):
log("((%d > 0) && (%d <= %d)): %d, second check: %d",
af->spell, af->spell, MAX_SPELLS, ((af->spell > 0) && (af->spell <= MAX_SPELLS)),
(!af->next || (af->next->spell != af->spell) ||
(af->next->duration > 0)));
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
I would really like this skill wear off to work...im not a log expert or code expert.
And gdb wont run with the limited memory... hope you can help
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Attachments:
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
- Posts: 751
- Thank you received: 143
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
- JTP
- Topic Author
- Offline
- Platinum Member
-
- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.