R > PVP & MVP Cash point on killed

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
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.

 
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.

 
Last edited by a moderator:
@@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
 
Last edited by a moderator:
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;

 
@@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


 
Last edited by a moderator:
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.

 
Last edited by a moderator:
@@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)

 
@@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.

 
Last edited by a moderator:
Back
Top