Jump to content
  • 0
mrlongshen

R > PVP & MVP Cash point on killed

Question

Hello.

Is that possible to make this in one script ? 

I want player get 1 cash point every times mvp killed and also pvping.

For mvp, lets announce to all map after the mob killed.

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

http://pastebin.com/j2LfhEwV

 

You have to change the .@mobIds array to the ids of the mobs you want to give rewards for, in your case the MVPs. I am sorry for this inconvinience but i couldn't find a solution that can tell if a certain mob id is a mvp. :/

 

To adjust the amounts of cash points the player gets you can use .mobRewardPoints and pvpRewardPoints, just change it to your needs.

 

The MVP one will announce it on all maps, the pvp on only on the according map.

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

@@Winterfox 

 

like this ?

 

.rewardMobIds[1649] = 1; //High Priest Magaleta / High Priest Margaretha
.rewardMobIds[1651] = 1; //High Wizard Katrinn / High Wizard Kathryne
.rewardMobIds[1646] = 1; //Lord Knight Seyren
 
[Error]: script error in file '(DIRECT INPUT)' line 19 column 203     parse_callfunc: not enough arguments, expected ','     16:         OnPCKillEvent:     17:                         #CASHPOINTS += .pvpRewardPoints;     18:                         dispbottom "You now have " + #CASHPOINTS + " Cash Point" + ((#CASHPOINTS > 1)? "s":"") + "."; *   19:                         mapannounce strcharinfo(PC_MAP), strcharinfo(PC_NAME) + " killed " + rid2name(killedrid) + " and earned "+ pvpRewardPoints +" Cash Point" + ((.pvpRewardPoints > 1)? "s":"") + ".";         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^     20:         end;     21: } 

I got this problem too

Edited by mrlongshen

Share this post


Link to post
Share on other sites
  • 0

mapannounce strcharinfo(PC_MAP), strcharinfo(PC_NAME) + " killed " + rid2name(killedrid) + " and earned " + .pvpRewardPoints +" Cash Point" + ((.pvpRewardPoints > 1)? "s" : "") + ".";

 

To

 

mapannounce strcharinfo(PC_MAP), strcharinfo(PC_NAME) + " killed " + rid2name(killedrid) + " and earned " + .pvpRewardPoints +" Cash Point" + ((.pvpRewardPoints > 1)? "s" : "") + ".",bc_map;

Share this post


Link to post
Share on other sites
  • 0

@@Dastgir thanks alot.

by the way I got this problem.

Every times annoucement, its show 0 point, not the value Im setitng. But on disbottom is correct.

announce strcharinfo(PC_NAME) + " killed " + strmobinfo(1, killedrid) + " and earned "+ mobRewardPoints +" Cash Point" + ((.mobRewardPoints > 1)? "s":"") + ".", bc_all;

 

gFIGiGt.png

Edited by mrlongshen

Share this post


Link to post
Share on other sites
  • 0

I still had a typo in this one. Check this version out: http://pastebin.com/BU4kry6p

 

It automatically adds the MVPs now.

 

.@mobIdListStr$ can be used to add custom monsters etc.

.@mobFilterListStr$ can be used to exclude monsters.

 

The syntax for both is like this.@mobIdListStr$ = "ID, ID, ID". Make sure to insert the space after every comma or it won't work properly.

 

The other two variables stayed the same.

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

@@Winterfox

You can't direct cast string to int.

E.g

.@mobIds[.@i] = .@mobIdList$[.@i];

Should be

.@mobIds[.@i] = atoi(.@mobIdList$[.@i]);

 

(There's other place too, which needs to be changed)

Share this post


Link to post
Share on other sites
  • 0

@@Dastgir I see thanks for the info. I thought it would work like that since the server didn't output a message if i directly tried to cast it like that and put it as array key afterwards.

 

May i ask you something else too? I use the IDs of the mobs as array keys to have not have to loop trough the whole list when i want to find out if a certain mob is part of it.

But i noticed that hercules seems to create as much elements as the biggest key i use, so i was wondering if it is a good idea to do it like that or if it is just better to use loops instead or if there is a way to prevent hercules from creating all this overhead elements.

 

Nevermind, i didn't read the doc properly that getarraysize returns the biggest index and not the real count of items.

Edited by Winterfox

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.