Fireshield crash

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6236 by JTP
JTP created the topic: Fireshield crash
Tried this to anul the effect, since fire vs fire shouldnt give damage, but i get this error below:
 /* Fireshield damages attacker */
  if (AFF_FLAGGED(ch, AFF_FIRESHIELD) && AFF_FLAGGED(victim, AFF_FIRESHIELD))
    return;
  else (AFF_FLAGGED(victim, AFF_FIRESHIELD) && GET_POS(victim) != POS_MORTALLYW) {


fight.c: In function ‘damage’:
fight.c:670: warning: ‘return’ with no value, in function returning non-void
fight.c:671: warning: statement with no effect
fight.c:671: error: expected ‘;’ before ‘{’ token


Or some other sulution so it doesnt crash.


Hope someone can help asap, cus my daughter and her friends are starting to have fireshield and fight mobs with fireshield.
Last Edit: 1 year 6 months ago by JTP.

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

More
1 year 6 months ago #6238 by thomas
thomas replied the topic: Fireshield crash
you're missing an "if" between "else" and "(AFF_FLAGGED..."

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

More
1 year 6 months ago #6239 by thomas
thomas replied the topic: Fireshield crash
And the method must return something. I suggest trying "return 0;" instead of "return;"

I also suggest you try and google your error messages.

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago #6240 by JTP
JTP replied the topic: Fireshield crash
With the else if in place there is still this one:

fight.c: In function ‘damage’:
fight.c:672: warning: ‘return’ with no value, in function returning non-void

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6242 by JTP
JTP replied the topic: Fireshield crash
Ok return 0; worked no more crash

But now they see this:

[AFK] 5000h(5000H) 479m(550M) 500v(500V)(100%) Excellent condition >
You parry Elminster Aumar's vicious attack!
Your fireshield has no effect agenst Elminster Aumar's fireshield.
Your fireshield has no effect agenst Elminster Aumar's fireshield.
Your fireshield has no effect agenst Elminster Aumar's fireshield.

[AFK] 5000h(5000H) 479m(550M) 500v(500V)(100%) Excellent condition >
Your fireshield has no effect agenst Elminster Aumar's fireshield.

[AFK] 5000h(5000H) 479m(550M) 500v(500V)(100%) Excellent condition >
You parry Elminster Aumar's vicious attack!
Your fireshield has no effect agenst Elminster Aumar's fireshield.
Your fireshield has no effect agenst Elminster Aumar's fireshield.


No real fighting takes place anymore now ? any ideas ?



If only 1 has fireshield on, fighting is normal.

[AFK] 4821h(5000H) 527m(550M) 500v(500V)(98%) A few scratches >
(78)Elminster Aumar OBLITERATES you with his deadly blast!!
(69)Elminster Aumar OBLITERATES you with his deadly blast!!
(92)Elminster Aumar OBLITERATES you with his deadly blast!!
You are burned when you hit Elminster Aumar.
(20) You massacre Elminster Aumar to small fragments with your pierce.
You are burned when you hit Elminster Aumar.
(21) You massacre Elminster Aumar to small fragments with your pierce.
Last Edit: 1 year 6 months ago by JTP.

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

More
1 year 6 months ago #6243 by thomas
thomas replied the topic: Fireshield crash
of course - the 0 indicates a miss or parry.

If you rewrite the logic slightly, will it work?
/* Fireshield damages attacker */
-  if (AFF_FLAGGED(ch, AFF_FIRESHIELD) && AFF_FLAGGED(victim, AFF_FIRESHIELD))
-    return 0;
-  else if (AFF_FLAGGED(victim, AFF_FIRESHIELD) && GET_POS(victim) != POS_MORTALLYW) {
+ if (AFF_FLAGGED(victim, AFF_FIRESHIELD) && !AFF_FLAGGED(ch, AFF_FIRESHIELD) && GET_POS(victim) != POS_MORTALLYW) {

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6244 by JTP
JTP replied the topic: Fireshield crash
+ if (AFF_FLAGGED(victim, AFF_FIRESHIELD) && !AFF_FLAGGED(ch, AFF_FIRESHIELD) && GET_POS(victim) != POS_MORTALLYW) {
Doesnt that mean victim has fireshield on, but "!AFF" char does not have fireshield on ?


What i need is does either char or victim have fireshield on, fight will begin and one gets damage from fireshield.

If both has fireshield on, fight should still occur, but neither takes damage from the fireshield.
Last Edit: 1 year 6 months ago by JTP.

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

More
1 year 6 months ago #6245 by thomas
thomas replied the topic: Fireshield crash
indeed, this will do that. But the real fix, I think is to damage by 0 when there's a fireshield on both chars.

So, replace the
return 0; 
in your code with
damage(victim, ch, 0, SPELL_FIRESHIELD);
That should do it.

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6246 by JTP
JTP replied the topic: Fireshield crash
if (AFF_FLAGGED(ch, AFF_FIRESHIELD) && AFF_FLAGGED(victim, AFF_FIRESHIELD))
return 0;
else if (AFF_FLAGGED(victim, AFF_FIRESHIELD) && GET_POS(victim) != POS_MORTALLYW) {


This Works for other players though:
Testchar is burned when he hits Elminster Aumar.
Testchar hits Elminster Aumar extremely hard.
Testchar is burned when he hits Elminster Aumar.
Testchar hits Elminster Aumar extremely hard.
You parry Elminster Aumar's vicious attack!
Your fireshield has no effect agenst Elminster Aumar's fireshield.
Your fireshield has no effect agenst Elminster Aumar's fireshield.



Or no the victim dont hit back.
Last Edit: 1 year 6 months ago by JTP.

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6247 by JTP
JTP replied the topic: Fireshield crash
damage(victim, ch, 0, SPELL_FIRESHIELD);

That crashed the mud
Last Edit: 1 year 6 months ago by JTP.

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

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 6 months ago - 1 year 6 months ago #6248 by JTP
JTP replied the topic: Fireshield crash
Ok the !AFF worked :)

Tank with fireshield didnt get any messages about hitting fireshield, but others in Group that didnt have fireshield on, got hit with fireshield messages when attacking victim.

Thanks alot Thomas
Last Edit: 1 year 6 months ago by JTP.

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

Time to create page: 1.373 seconds