The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prevent players from losing fame against NPC's
Author Message
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #1
Prevent players from losing fame against NPC's
Hello everyone I'm new around here and don't have much experience on scripting.

I would like to know how can I prevent players from losing fame when they die against NPC's.

When players kill players or die to players the fame calculation is at an event used by all players, under the @kill trigger. It will calculate fame for both victim and killers.

If the victim is a monster the fame won't change to the killer (player).

However, if the victim is the player and the killer is a monster there is something changing the player fame.

Anyone have any idea what can be causing this?

The message is most the times "you have lost huge amounts of fame"

Thanks in advance.
10-31-2013 02:14 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Prevent players from losing fame against NPC's
10-31-2013 03:02 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #3
RE: Prevent players from losing fame against NPC's
Thanks for your answer, but where should I use that trigger?

If I use on players for example, how do I say "if there fame is about to change because of NPC's then dont change"?

Tried using it several times and never worked.
10-31-2013 03:54 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Prevent players from losing fame against NPC's
You could make some workaround like this
Code:
ON=@DeathCorpse
ref1=<attacker.last>
if (<ref1.npc>>0)
tag.nofameloss
endif

ON=@FameChange
if (<tag0.nofameloss>)
tag.nofameloss
return 1
endif
10-31-2013 04:57 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #5
RE: Prevent players from losing fame against NPC's
(10-31-2013 04:57 AM)XuN Wrote:  You could make some workaround like this
Code:
ON=@DeathCorpse
ref1=<attacker.last>
if (<ref1.npc>>0)
tag.nofameloss
endif

ON=@FameChange
if (<tag0.nofameloss>)
tag.nofameloss
return 1
endif

on=@death and i would suggest loop through all attackers, if there is a player => fame down, if not, fame wont change
10-31-2013 06:35 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #6
RE: Prevent players from losing fame against NPC's
Thanks to both of you! It worked.

Just another question.

When it calculates fame, if I set it to gain 500 it gains 500, but if I set it to lose 500 it will lose more. Why is that? Any way to fix?
10-31-2013 06:58 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #7
RE: Prevent players from losing fame against NPC's
Are you changing argn1 and returning 0 in the trigger, or how do you modify it?
10-31-2013 08:09 AM
Find all posts by this user Like Post Quote this message in a reply
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #8
RE: Prevent players from losing fame against NPC's
post the line where you subtract the fame so we can see if its something to do with hex.

[Image: matts_siggy.gif]
10-31-2013 09:28 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #9
RE: Prevent players from losing fame against NPC's
Let's assume LOCAL.FAMECHANGE is always 500.

This is the killer fame change:

Code:
FAME    = <eval (<FAME> + <LOCAL.FAMECHANGE>)>
   IF ( <FAME> > 10000 )
      FAME    = 10000
   ELSEIF ( <FAME> == 0 )
      FAME    = 0
   ENDIF

And this the victim fame change:

Code:
LOCAL.FAMECHANGE = <EVAL (0 - <LOCAL.FAMECHANGE>)>
   OBJ.FAME    = <OBJ.FAME> + <LOCAL.FAMECHANGE>
   IF ( <OBJ.FAME> > 10000 )
      OBJ.FAME    = 10000
   ELSEIF ( <OBJ.FAME> == 0 )
      OBJ.FAME    = 0
   ENDIF

Although the local.famechange is exactly the same (500) the victim will always lose way more.
(This post was last modified: 10-31-2013 09:49 AM by pointhz.)
10-31-2013 09:48 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #10
RE: Prevent players from losing fame against NPC's
hmmm, you mean this?
Code:
on=@famechange
   <qval <argn1> < 0 ? argn1=-500:argn1=500>
   return 0
I'm confused... somebody else must try to help you. It sometimes take me a long time to understand what others want to help with. Confused
(This post was last modified: 11-01-2013 12:17 AM by Alaric.)
11-01-2013 12:17 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)