- Posts: 10
- Thank you received: 1
Dirt Kick
- soth
- Topic Author
- Offline
- New Member
-
Less
More
7 months 3 weeks ago #9933
by soth
Dirt Kick was created by soth
Hi,
Just trying to find a snippet that will get me started with a skill called <dirt_kick>. What I would like for it to do is this. If a kick lands then have a percentage to blind the target if the mob is not noblind. I have the skill working atm and had to resort to a cast_spell, but I would rather be able to apply the aff modifiers myself and the message. I have tried to google, but cannot seem to find anything.
Thanks
Just trying to find a snippet that will get me started with a skill called <dirt_kick>. What I would like for it to do is this. If a kick lands then have a percentage to blind the target if the mob is not noblind. I have the skill working atm and had to resort to a cast_spell, but I would rather be able to apply the aff modifiers myself and the message. I have tried to google, but cannot seem to find anything.
// check to see if mob can be blinded or not
594 if (MOB_FLAGGED(vict, MOB_NOBLIND)) {
595 send_to_char(ch, "mob has NOBLIND BITVECTOR\r\n"); // :: TESTING ::
596 }
597 else {
598 cast_spell(ch, vict, NULL, SPELL_BLINDNESS);
599 //af[0].location = APPLY_HITROLL;
600 //af[0].modifier = -5;
601 //af[0].duration = 2;
602 //SET_BIT_AR(af[0].bitvector, AFF_BLIND);
603 //send_to_char(ch, "mob can be blinded!!\r\n"); // TESTING ::
604 damage(ch, vict, rand_number(1, GET_LEVEL(ch)), SKILL_DIRT_KICK);
605 }
Thanks
Please Log in or Create an account to join the conversation.
- soth
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 1
7 months 3 weeks ago #9934
by soth
Replied by soth on topic Dirt Kick
Here is what I came up with yesterday. I have probably missed a few things and if anyone has any suggestions or an easier way of coding feel free to post :)
act.offensive.c
act.offensive.c
ACMD(do_dirt_kick)
{
char arg[MAX_INPUT_LENGTH];
struct char_data *vict;
struct affected_type af;
int percent, prob;
// dirt skill not learned automatic failure
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_DIRT_KICK)) {
send_to_char(ch, "You have no idea how.\r\n");
return;
}
one_argument(argument, arg);
if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM))) {
if (FIGHTING(ch) && IN_ROOM(ch) == IN_ROOM(FIGHTING(ch)))
vict = FIGHTING(ch);
else {
send_to_char(ch, "Dirt Kick who?\r\n");
return;
}
}
// do nothing if trying to dirt kick self
if (vict == ch) {
send_to_char(ch, "Aren't we funny today...\r\n");
return;
}
// vars to check if we land a kick or not
percent = ((10 - (compute_armor_class(vict) / 10)) * 2) + rand_number(1,101);;
prob = GET_SKILL(ch, SKILL_DIRT_KICK);
// ch misses victim, using TYPE_UNDEFINED instead of SKILL_DIRT_KICK messages in <message> file.
if (percent > prob) {
act("\r\n\tyYou try to kick dirt in $N's eyes, but slip and fall!\tn.", FALSE, ch, 0, vict, TO_CHAR);
act("\r\n\ty$n tries to kick dirt in $N's eyes, but slips and falls to the ground!\tn.", TRUE, ch, 0, vict, TO_NOTVICT);
damage(ch, vict, 0, TYPE_UNDEFINED);
}
else {
// we have a chance to hit!
// check to see if mob can be blinded or not
if (MOB_FLAGGED(vict, MOB_NOBLIND)) {
act("\tgYou try to kick dirt in $N's face, but nothing happens.\tn.", FALSE, ch, 0, vict, TO_CHAR);
}
else {
// if vict is not affected by blind then apply the debuffs
if (!AFF_FLAGGED(vict, AFF_BLIND)) {
new_affect(&af);
af.spell = SKILL_DIRT_KICK;
af.location = APPLY_HITROLL;
af.modifier = -10;
af.duration = 1;
SET_BIT_AR(af.bitvector, AFF_BLIND);
affect_to_char(vict, &af);
new_affect(&af);
af.spell = SKILL_DIRT_KICK;
af.location = APPLY_AC;
af.modifier = 40;
af.duration = 1;
SET_BIT_AR(af.bitvector, AFF_BLIND);
affect_to_char(vict, &af);
damage(ch, vict, rand_number(1, GET_LEVEL(ch)), TYPE_UNDEFINED);
act("\tgYou temporarily \tWblind\tg $N\tn.", FALSE, ch, 0, vict, TO_CHAR);
act("\tg$N is temporarily \tWblinded\tn.", TRUE, ch, 0, vict, TO_NOTVICT);
act("\tgYou kick dirt in $N's face!\tn.", FALSE, ch, 0, vict, TO_CHAR);
}
else {
damage(ch, vict, rand_number(1, GET_LEVEL(ch)), TYPE_UNDEFINED);
act("\r\n\tgYou kick dirt in $N's eyes!\tn.", FALSE, ch, 0, vict, TO_CHAR);
act("\r\n\tg$n kicks dirt in $N's eyes!\tn.", TRUE, ch, 0, vict, TO_NOTVICT);
}
}
}
// wait period
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
}
The following user(s) said Thank You: thomas
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 751
- Thank you received: 143
7 months 3 weeks ago #9935
by thomas
Replied by thomas on topic Dirt Kick
This is both a nice idea and a good implementation.
I would sure not wish to be dirt kicked with that debuff ;)
I would sure not wish to be dirt kicked with that debuff ;)
The following user(s) said Thank You: soth
Please Log in or Create an account to join the conversation.
- soth
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 1
7 months 3 weeks ago #9937
by soth
Replied by soth on topic Dirt Kick
Hi Thomas,
Thanks! I'm sure it would need fine tuned on the affects and damage according to how someone's mud is setup, but so far from testing it appears to be flowing like it's supposed to.
Kevin
Thanks! I'm sure it would need fine tuned on the affects and damage according to how someone's mud is setup, but so far from testing it appears to be flowing like it's supposed to.
Kevin
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds