Jump to content
  • 0

How to enable MvP Ranking System only on specific maps?


Tdi123

Question


  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

The MvP Ranking System is flowing normally.
But he is counting all the MvPs, even the MvPs GM invokes.
My idea would be for the system to count only the Specifics MvPs.
Example:
case 1832:
     if (thor_v03) {
        goto addpoints;
        end;
     }
     end;

Or something like that...
I want the points to count only for the MvPs on their respective maps. 

Thank you for your help

script: https://pastebin.com/1jYCRkfx

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

?‍♂️

-	script	GlobalMvP::GlobalMvP	-1,{
OnNPCKillEvent:
	if(inarray(.AllowedMaps$,strcharinfo(3)) != -1 && inarray(.MVP_IDS,killedrid) != -1){
		query_sql "SELECT `name` FROM `mvp` WHERE `char_id`="+getcharid(0)+"",.@name$;
		if ( .@name$ == "" ) { query_sql "INSERT INTO `mvp` (`char_id`,`name`,`kills`,`points`) VALUES (" + getcharid(0) + ",'" + escape_sql(strcharinfo(0)) + "',1,1)"; end; }
		query_sql "UPDATE `mvp` SET `kills` = (`kills` + 1), `points` = (`points` +1) WHERE `char_id`=" + getcharid(0);
	}
end;
OnInit:
	query_sql("CREATE TABLE IF NOT EXISTS `mvp` (`char_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '0', `kills` int(11) unsigned NOT NULL DEFAULT '0',`points` int(11) unsigned NOT NULL DEFAULT '0', `level` int(11) unsigned NOT NULL DEFAULT '0', KEY `char_id` (`char_id`), KEY `kills` (`kills`), KEY `points` (`level`), KEY `level` (`level`)) ENGINE=MyISAM");
	
	setarray .AllowedMaps$,"prontera","map_name";//put the names of the allowed maps.
	
	setarray .MVP_IDS,
		1511,// Amon Ra
		1647,// B_EREMES
		1785,// Atroce
		1630,// BACSOJIN_
		1039,// Baphomet
		1874,// BEELZEBUB_
		1272,// Dark Lord
		1719,// Detale
		1046,// Doppelganger
		1389,// Dracula
		1112,// Drake
		1115,// Eddga
		1957,// Entweihen
		1418,// Evil Snake Lord
		1871,// FALLINGBISHOP
		1252,// Garm
		1768,// GLOOMUNDERNIGHT
		1086,// Golden Bug
		1802,// G_MAGALETA
		1649,// High Priest Magaleta
		1651,// High Wizard Katryne
		1832,// Ifrit
		1492,// Incantation Samurai
		1734,// Kiel_
		1251,// Stormy Knight
		1779,// Ktullanux
		1688,// Lady Tanee
		1640,// G_SEYREN
		1646,// Lord Knight Seyren
		1373,// Lord of Death
		1147,// Maya
		1059,// Mistress
		1150,// Moonlight flower
		1956,// Naght Seiger
		1087,// Orc Hero
		1190,// Orc Lord
		1038,// Osiris
		1157,// Pharaoh
		1159,// Phreeoni
		1502,// Poripori
		1623,// RSX
		1650,// Sniper Cecil// Sniper Shecil
		1583,// Tao Gunka
		1708,// Thanatos
		1312,// Turtle General
		1765,// Valkyrie
		1751,// Valkyrie rangdris
		1685,// Vesper
		1648,// Whitesmith Howard
		1917,// Satan Morroc
		1658,// Egnigem Cenia
		1885,// Zmey Gorynych
		1990,// Hard Rock Mamooth
		1991;// Tendrillion
end;
}

Also i don't see why the use of sql

 

i think there is already ready-to-use mvp rank scripts if you use the search , it would be better than building your own.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

1 hour ago, sader1992 said:

?‍♂️


-	script	GlobalMvP::GlobalMvP	-1,{
OnNPCKillEvent:
	if(inarray(.AllowedMaps$,strcharinfo(3)) != -1 && inarray(.MVP_IDS,killedrid) != -1){
		query_sql "SELECT `name` FROM `mvp` WHERE `char_id`="+getcharid(0)+"",.@name$;
		if ( .@name$ == "" ) { query_sql "INSERT INTO `mvp` (`char_id`,`name`,`kills`,`points`) VALUES (" + getcharid(0) + ",'" + escape_sql(strcharinfo(0)) + "',1,1)"; end; }
		query_sql "UPDATE `mvp` SET `kills` = (`kills` + 1), `points` = (`points` +1) WHERE `char_id`=" + getcharid(0);
	}
end;
OnInit:
	query_sql("CREATE TABLE IF NOT EXISTS `mvp` (`char_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '0', `kills` int(11) unsigned NOT NULL DEFAULT '0',`points` int(11) unsigned NOT NULL DEFAULT '0', `level` int(11) unsigned NOT NULL DEFAULT '0', KEY `char_id` (`char_id`), KEY `kills` (`kills`), KEY `points` (`level`), KEY `level` (`level`)) ENGINE=MyISAM");
	
	setarray .AllowedMaps$,"prontera","map_name";//put the names of the allowed maps.
	
	setarray .MVP_IDS,
		1511,// Amon Ra
		1647,// B_EREMES
		1785,// Atroce
		1630,// BACSOJIN_
		1039,// Baphomet
		1874,// BEELZEBUB_
		1272,// Dark Lord
		1719,// Detale
		1046,// Doppelganger
		1389,// Dracula
		1112,// Drake
		1115,// Eddga
		1957,// Entweihen
		1418,// Evil Snake Lord
		1871,// FALLINGBISHOP
		1252,// Garm
		1768,// GLOOMUNDERNIGHT
		1086,// Golden Bug
		1802,// G_MAGALETA
		1649,// High Priest Magaleta
		1651,// High Wizard Katryne
		1832,// Ifrit
		1492,// Incantation Samurai
		1734,// Kiel_
		1251,// Stormy Knight
		1779,// Ktullanux
		1688,// Lady Tanee
		1640,// G_SEYREN
		1646,// Lord Knight Seyren
		1373,// Lord of Death
		1147,// Maya
		1059,// Mistress
		1150,// Moonlight flower
		1956,// Naght Seiger
		1087,// Orc Hero
		1190,// Orc Lord
		1038,// Osiris
		1157,// Pharaoh
		1159,// Phreeoni
		1502,// Poripori
		1623,// RSX
		1650,// Sniper Cecil// Sniper Shecil
		1583,// Tao Gunka
		1708,// Thanatos
		1312,// Turtle General
		1765,// Valkyrie
		1751,// Valkyrie rangdris
		1685,// Vesper
		1648,// Whitesmith Howard
		1917,// Satan Morroc
		1658,// Egnigem Cenia
		1885,// Zmey Gorynych
		1990,// Hard Rock Mamooth
		1991;// Tendrillion
end;
}

Also i don't see why the use of sql

 

i think there is already ready-to-use mvp rank scripts if you use the search , it would be better than building your own.

Thanks for your help, but this MvP Ranking is linked to my Site, it will show in real time the MvPs Killers

Example:

 

 

Sem título.jpg

Edited by Tdi123
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

btw , this will only work on monsters without label

something like Lord of Death or biolab 3(with their normal spawn), you need to edit the main script to work , you need to find the npc that have it's label , add your codes to that label too

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

Your script is almost perfect.
Example:
Npc still allows MvP 1511 Points, // Amon Ra, to count on map "thor_v03"

My idea would be:
I prevented players with Bloody Branches from gaining easy points on any existing map mvp

It would look something like this:
Killer MvP 1832 "Ifrit" on map thor_v03, goto addpoints;
npc and the system are ready. All I need is players not to circumvent the system using bloody twigs
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

-	script	GlobalMvP::GlobalMvP	-1,{
OnNPCKillEvent:
	if(inarray(getd(".MVP_" + strcharinfo(3)),killedrid) != -1){
		query_sql "SELECT `name` FROM `mvp` WHERE `char_id`="+getcharid(0)+"",.@name$;
		if ( .@name$ == "" ) { query_sql "INSERT INTO `mvp` (`char_id`,`name`,`kills`,`points`) VALUES (" + getcharid(0) + ",'" + escape_sql(strcharinfo(0)) + "',1,1)"; end; }
		query_sql "UPDATE `mvp` SET `kills` = (`kills` + 1), `points` = (`points` +1) WHERE `char_id`=" + getcharid(0);
	}
end;
	function AddMvP {
		for(.@i=1;.@i<getargcount();.@i++){
			setd ".MVP_" + getarg(0) + "[" + .@i + "]",getarg(.@i);
		}
		return;
	}

OnInit:
	query_sql("CREATE TABLE IF NOT EXISTS `mvp` (`char_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '0', `kills` int(11) unsigned NOT NULL DEFAULT '0',`points` int(11) unsigned NOT NULL DEFAULT '0', `level` int(11) unsigned NOT NULL DEFAULT '0', KEY `char_id` (`char_id`), KEY `kills` (`kills`), KEY `points` (`level`), KEY `level` (`level`)) ENGINE=MyISAM");
	freeloop(1);
		//AddMvP(<"MAP_NAME">,<MVP ID>{,<MVP ID>});
		//you can add as much as you want mvp ids
		AddMvP("prontera",1002);
		AddMvP("payon",1002,1003,1004);
		AddMvP("geffen",1546);
	freeloop(0);
end;
}

 

  • Upvote 1
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...