Jump to content
  • 0

MVP Ranker w/ Rewards


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hey guys, This idea come's to my mind while changing how MVP monsters can be killed.

So let's move on to my idea...

First this is how the menu works

switch(select("Server Ranking","MVP Goal","Open MVP Shop"))

1. Server Ranking : This will display who got the highest score in the server. Not a specific MVP monster but overall record.

2. MVP Goal : For this option it will display a list of MVP that will be available when players reached the set points to unlocked a specific MVP card.

Example :

#	MVPNAME	GOALPOINTS
1.	Amon Ra	: 1000
2.	Atroce	: 1500
3.	Bacsojin	: 2000
4.	Baphomet	: 2000
5.	Detale	: 2000

Everytime a player killed one of those MVP's the `GOALPOINTS` will reduced until it become 0 and GOAL will be unlocked and card will be available on the shop.
and when a player killed an MVP monster they'll gain 1 MVPPOINTS per MVP monsters. and points can be used inside the MVP Shop.

3. Open MVP Shop : An exclusive shop only for those who got MVPPOINTS , Shop will ignored players without the specific points.

  • MVP cards will only be available in the shop when the GOALPOINTS are meet by all the players.
  • MVP cards price will be define on their GOALPOINTS = [2000 / 4] and result will be the price of the MVP card.
  • Shop will inform players if there's an available card to buy. something like an announcement
announce "[ MVP Seeker ] : Congratulations Players!!! you unlocked the `Phreeoni Monster` check the shop now!",bc_all;

 

Edited by Radian
Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

just a friendly reminder

you do know that OnNPCKillEvent only trigger by who land the last hit on the MVP (default), or the most damage depends on battle_config.mob_npc_event_type

means, only 1 person is recorded in the rank

it doesn't record those who actually help defeating the MVP, well, playing as priest sux

 

in other words, your idea only give points to those DD(damage dealer) or who land the lucky last hit, not as the group effort

 

EDIT: nvm, sometimes I forgot the most basic thing

can just OnNPCKillEvent: and then loop with the *getpartymember, and preferably having battle_config.mob_npc_event_type == 0

anyways do you have any MVP ranker script atm ? I do made MVP ranker script in hercules forum b4 though ...

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

7 hours ago, AnnieRuru said:

just a friendly reminder

you do know that OnNPCKillEvent only trigger by who land the last hit on the MVP (default), or the most damage depends on battle_config.mob_npc_event_type

means, only 1 person is recorded in the rank

it doesn't record those who actually help defeating the MVP, well, playing as priest sux

 

in other words, your idea only give points to those DD(damage dealer) or who land the lucky last hit, not as the group effort

Yeah your right about the one who last hit the MVP will only get the points, but In my server (still on progress) I removed all MVP monsters from the maps where they re-spawned. and replace it with a special event where they can enter the room when MVP is alive.

7 hours ago, AnnieRuru said:

EDIT: nvm, sometimes I forgot the most basic thing

can just OnNPCKillEvent: and then loop with the *getpartymember, and preferably having battle_config.mob_npc_event_type == 0

anyways do you have any MVP ranker script atm ? I do made MVP ranker script in hercules forum b4 though ...

I wish, I can give you feedbacks with that, but to tell you the truth i have no idea about the `*getpartymember` and those loop thing...

Anyway.. I don't have any MVP ranker script at this moment... I'll look for it if you want..

I found this MVP ladder scripts
1. https://rathena.org/board/files/file/3717-mvp-ladder-only-on-mvp-maps-with-announcer/

2. http://pastebin.com/raw/gcXecTvs

I got those scripts so far...

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

1st script ... oh that member @pajodex is still active

query_sql("SELECT char_id, CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE `key` = 'MVPKills' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);

this line ... is not optimized, for the reason ... read the topic I linked below

 

that 2nd script ... makes me laugh ...

in short, even Euphy himself said don't use this script

 

so remember ... when you write a SQL script that has WHERE clause, make sure that field is indexed

otherwise the SQL will perform full table search


anyways

23 hours ago, Radian said:

Yeah your right about the one who last hit the MVP will only get the points, but In my server (still on progress) I removed all MVP monsters from the maps where they re-spawned. and replace it with a special event where they can enter the room when MVP is alive.

I don't really understand this part ... do you mean your server has MVP room like this one ?

https://github.com/rathena/rathena/blob/master/npc/custom/etc/mvp_room.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

7 minutes ago, AnnieRuru said:

I don't really understand this part ... do you mean your server has MVP room like this one ?

No.. Its different from what I got in my server... Its a event type of MVP Room

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

What I'm still wondering, do the goalpoints decrease also by 1 for each mvp? Or is that more?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

19 minutes ago, llchrisll said:

What I'm still wondering, do the goalpoints decrease also by 1 for each mvp? Or is that more?

GOLDPOINTS will only decrease if a specific MVP has been killed.

for instance, I killed 1 PHREEONI and the remaining GOALPOINTS of PHREEONI is 10. It will reduced 1 GOALPOINTS and become 9, since I killed 1 PHREEONI at that time.

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Bump. willing to pay for it, just DM me.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

I hope it works like intended and I didn't miss anything.... :)

mvp_ranker.txt

Regards,
Chris

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

41 minutes ago, llchrisll said:

I hope it works like intended and I didn't miss anything.... :)

mvp_ranker.txt

Regards,
Chris

Perfect man, thank you so much!!!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

@llchrisll reporting..

Untitled1.png.bebeb8ba7cf5a26acba7986ff788003d.png

result :

Untitled2.png.57240a012ca2d6aae709db1fe9b598a2.png

Im not sure if i messed up something or its the script.

Edit : Also on the party side party.

This images is for the one who last hit the mvp.

Untitled1.png.554690448f93595d8617a02d84d89314.png

and for this one the rest of the party members

Untitled2.png.8a35fd258eca783dffff3cb7c64650b2.png

And also, If the MVP monster was summoned like this

monster instance_mapname("desert"),50,61,"--ja--",'instance_mob_id,1,instance_npcname("mvproom_helper")+"::OnMyMobDead";

monster instance_mapname("desert"),50,61,"--ja--",'instance_mob_id,1,instance_npcname("mvproom_helper")+"::OnMyMobDead";

Its not recorded.

Thanks in advance...

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@llchrisll

query_sql "SELECT `char_name` , `mvp_points` FROM `mvp_rank` ORDER BY `mvp_points` DESC LIMIT 10",.@c_name$,.@mvp_pts;

please index your `mvp_points` field when creating the table, this query will perform full table search if you don't index the field properly

 

line 56

for ( set .@r,0; .@r < getarraysize(.@c_name$); set .@r,.@r + 1)
	        mes (.@r+1)+". "+.@c_name$+" - "+.@mvp_pts+" Points";

yup missing .@c_name$[.@r] and .@mvp_pts[.@r]

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Another issue with the script is this, adding most of the npc will result

// MvP ID's to Hunt:
// Put every MvP ID here, which should be hunted
setarray .mvp_id[0],	1511,	// Amonra
			1785,	// Atroce
			1630,	// Bacsojin
			1039,	// Baphomet
			1272,	// Dark Lord
			1719,	// Detale
			1046,	// Doppelganger
			1389,	//
			1112,
			1115,
			1418,
			1871,
			1252,
			1768,
			1086,
			1832,
			1492,
			1734,
			1251,
			1779,
			1688,
			1373,
			1147,
			1059,
			1087,
			1190,
			1038,
			1157,
			1159,
			1623,
			1583,
			1708,
			1312,
			1751,
			1685,
			1658;

and error in the map server

[Error]: script:run_script_main: infinity loop !
[Debug]: Source (NPC): MvP Ranker at prontera (150,155)

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

10 hours ago, Radian said:

@llchrisll reporting..

Untitled1.png.bebeb8ba7cf5a26acba7986ff788003d.png

result :

Untitled2.png.57240a012ca2d6aae709db1fe9b598a2.png

Im not sure if i messed up something or its the script.

Edit : Also on the party side party.

This images is for the one who last hit the mvp.

Untitled1.png.554690448f93595d8617a02d84d89314.png

and for this one the rest of the party members

Untitled2.png.8a35fd258eca783dffff3cb7c64650b2.png

And also, If the MVP monster was summoned like this

monster instance_mapname("desert"),50,61,"--ja--",'instance_mob_id,1,instance_npcname("mvproom_helper")+"::OnMyMobDead";


monster instance_mapname("desert"),50,61,"--ja--",'instance_mob_id,1,instance_npcname("mvproom_helper")+"::OnMyMobDead";

Its not recorded.

Thanks in advance...

1st Problem:
That's the mistake which mentionied @AnnieRuru. Fix shortly.

2nd Problem:
What do you mean with the party side party?
I added the "feature" that every party member also recieves MvP Points, not only the who deals the last hit.

3rd Problem:
Well, you mentioned that you have your own Event Room like that for the MvP's, but I didn't bother asking if you have an Event for that already.
Also I trusted that you would be able to manage to "move" the "OnNPCKillEvent" part to your "OnMyMobDead" Event.
Well, I forgot to adjust it so you can move it without issue.

 

10 hours ago, AnnieRuru said:

@llchrisll

query_sql "SELECT `char_name` , `mvp_points` FROM `mvp_rank` ORDER BY `mvp_points` DESC LIMIT 10",.@c_name$,.@mvp_pts;

please index your `mvp_points` field when creating the table, this query will perform full table search if you don't index the field properly

 

line 56


for ( set .@r,0; .@r < getarraysize(.@c_name$); set .@r,.@r + 1)
	        mes (.@r+1)+". "+.@c_name$+" - "+.@mvp_pts+" Points";

yup missing .@c_name$[.@r] and .@mvp_pts[.@r]

So that I don't misunderstand, what do you mean by "index". I basically know only the basic stuff as you can see about SQL.
You mean something like this?

CREATE TABLE `mvp_rank` (
 `char_id` int(10) UNSIGNED NOT NULL,
 `char_name` varchar(255) NOT NULL DEFAULT 'Unknown',
 `mvp_points` int(10) UNSIGNED DEFAULT '0',
KEY `mvp_points` (`mvp_points`),
PRIMARY KEY ( `char_id` )
 ) ENGINE=MyISAM;


Line 56:
Not sure why I missed that "newbie" mistake, but happens sometimes xD.

 

8 hours ago, Radian said:

Another issue with the script is this, adding most of the npc will result


// MvP ID's to Hunt:
// Put every MvP ID here, which should be hunted
setarray .mvp_id[0],	1511,	// Amonra
			1785,	// Atroce
			1630,	// Bacsojin
			1039,	// Baphomet
			1272,	// Dark Lord
			1719,	// Detale
			1046,	// Doppelganger
			1389,	//
			1112,
			1115,
			1418,
			1871,
			1252,
			1768,
			1086,
			1832,
			1492,
			1734,
			1251,
			1779,
			1688,
			1373,
			1147,
			1059,
			1087,
			1190,
			1038,
			1157,
			1159,
			1623,
			1583,
			1708,
			1312,
			1751,
			1685,
			1658;

and error in the map server


[Error]: script:run_script_main: infinity loop !
[Debug]: Source (NPC): MvP Ranker at prontera (150,155)

 

Well, seems like I forgot to add "freeloop(1)" or an sleep in the loop.
Like mentioned above, fix coming soon.

Edit: Here is the fixed version:
mvp_ranker.txt

Regards,
Chris

Edited by llchrisll
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

2 hours ago, llchrisll said:

1st Problem:
That's the mistake which mentionied @AnnieRuru. Fix shortly.

Yes, Its working..

2 hours ago, llchrisll said:

2nd Problem:
What do you mean with the party side party?
I added the "feature" that every party member also recieves MvP Points, not only the who deals the last hit.

As you can see on the images.. the other members slaying null!. instead of the exact monster name.

 

2 hours ago, llchrisll said:

3rd Problem:
Well, you mentioned that you have your own Event Room like that for the MvP's, but I didn't bother asking if you have an Event for that already.
Also I trusted that you would be able to manage to "move" the "OnNPCKillEvent" part to your "OnMyMobDead" Event.
Well, I forgot to adjust it so you can move it without issue.

Yeah, It was my fault about this part.. but thanks for making this script man i'll test it as soon as possible.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Oh didn't see that in the image, just save the killedrid value in a variable and use that instead of it like:

set .@mid, killedrid;

You could also change the text by saying "... for the defeating the MVP.".

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@llchrisll <3

yup ~ that's the way

 

sometimes using freeloop doesn't fix the problem ... sometimes ... well ... have to go learn advance SQL commands ~

http://upaste.me/95e24958012032bb6

 

also, I saw that instance script (made by Emistry), and by reading your script too, I finally understand everything what he actually wants

I admit if you didn't make this script, I might forever never understand his request XD  ... give you a rep  ~

 

since I completely rewrite the script, I believe there shouldn't be any ... bug ?

well, now I go implement this on the script made by Emistry

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

4 minutes ago, AnnieRuru said:

yup ~ that's the way

 

sometimes using freeloop doesn't fix the problem ... sometimes ... well ... have to go learn advance SQL commands ~

http://upaste.me/95e24958012032bb6

 

also, I saw that instance script (made by Emistry), and by reading your script too, I finally understand everything what he actually wants

I admit if you didn't make this script, I might forever never understand his request XD  ... give you a rep  ~

Thanks annie, just one more issue here is when i set it up like this

	setarray .mvp_id[0],	1511,	// Amonra
			1785,	// Atroce
			1630,	// Bacsojin
			1039,	// Baphomet
			1272,	// Dark Lord
			1719,	// Detale
			1046,	// Doppelganger
			1389,	//
			1112,
			1115,
			1418,
			1871,
			1252,
			1768,
			1086,
			1832,
			1492,
			1734,
			1251,
			1779,
			1688,
			1373,
			1147,
			1059,
			1087,
			1190,
			1038,
			1157,
			1159,
			1623,
			1583,
			1708,
			1312,
			1751,
			1685,
			1658;
	// Goal Points required
	setarray .mvp_goal[0],	1511,	// Amonra
				1785,	// Atroce
				1630,	// Bacsojin
				1039,	// Baphomet
				1272,	// Dark Lord
				1719,	// Detale
				1046,	// Doppelganger
				1389,	//
				1112,
				1115,
				1418,
				1871,
				1252,
				1768,
				1086,
				1832,
				1492,
				1734,
				1251,
				1779,
				1688,
				1373,
				1147,
				1059,
				1087,
				1190,
				1038,
				1157,
				1159,
				1623,
				1583,
				1708,
				1312,
				1751,
				1685,
				1658;

Error in map server appears like this

[Error]: script:run_script_main: infinity loop !
[Debug]: Source (NPC): MvP Ranker at poring_w01 (100,100)

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Cure !!

(AnnieRuru optimize the script)

http://upaste.me/95e24958012032bb6

 

I also changed the configuration part to be just like yours

no freeloop needed ~

  • Love 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

I have to admit, thanks for the help @AnnieRuru

I know there are better ways to use SQL tho, but I'm too "dumb" to use 'em, just like LEFT JOIN and so on.
I get the idea behind it, but as soon as I want to use it, I'm getting confused by it xD.

Maybe I will keep this "example" as tutorial, try to understand it and then use it in my next script which might be using SQL in anyway.

Well I'm also far from your scripting level, so I don't mind getting help in this kind of way :P.

Also you could have added your "signature" in the version part :), like this:

//===== Version ==============================================
//= 1.0 - Initial Version
//= 1.1 - Fixed Ranking Display
//      - Exchanged .mvp_ with $@mvp_ variables
//      - Modified OnMvPCardUnlock to be a function
//      - Added freeloop(); to prevent infinite loop <<----- DON'T NEED ANY freeloop
//= 1.2 - Improved by AnnieRuru <3

Anyway, in short thanks again for the help by improving this fine example for me to learn from ;P.

Regards,
Chris

  • Love 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  04/20/19
  • Last Seen:  

Hello, someone can explain me how work script please, i add sql tables on my db but i have error

image.thumb.png.f23e4aad0a95a6f2dbab65318559141f.png

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   120
  • Joined:  05/23/12
  • Last Seen:  

U need to write correct upper- and lowercase for the field u select over query.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  04/20/19
  • Last Seen:  

Thank you for the answers, unfortunately I can't do it I still have "unknown column on field type"

Edit: is work now the column name drop8_item on my db

Sorry but now i have a new error if someone can me help please

image.png.c6a6641a1d38b0d264d3083030e79900.png

up pleaase

bump

Edited by Yaziid91
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...