Jump to content

Hossam

Members
  • Posts

    92
  • Joined

  • Last visited

Posts posted by Hossam

  1. On 10/6/2017 at 3:12 AM, Aureon said:

    @Hossam You wanted to reset the values regardless if players are online or not?

    Tho, i haven't tried to run this in-game but I hope this solves your problem, good luck! ;)

    
    //===== Stolao Scripts ================================== 
    //= PvP Ladder
    //===== Author ================================================== 
    //= Stolao (Original Author)
    //= Happy (2.0)
    //= Aureon (2.3)
    //===== Current Version: ===================================== 
    //= 2.3(unofficial)
    //===== Compatible With: ===================================== 
    //= rAthena SVN, Hercules, 3ceam, eAthena
    //===== Description: =========================================
    // Configurable Pvp Ladder
    //===== Comments: ============================================
    //= [Stolao]
    //  Needs bug testing, please report any bugs
    //  Unable to test thurally on my comp atm
    //= [Happy]
    //  Update* I tested it and found tons of bugs, I'm in rush so 
    //  I fixed them myself. It is now working 100%. 
    //  The version is unofficial version. Sorry Stolao I fixed it
    //  Without your permission XD
    //= [Aureon]
    //  Update* I made it all pk values of all characters to be 
    //  deleted upon reset (made through request)
    //  link: https://rathena.org/board/topic/113064-pvp-rank-reset/
    //===== Additional Comments: =================================
    //= 1.00 Initial Release
    //= 1.01 Added Location with veiwing of ladder
    //= 1.02 Added GM Menu
    //= 1.03 Added atcommand
    //= 1.04 Shortend menu script
    //= 1.05 Added PvpPoints into confug and script
    //= 1.06 Added Abuse Protection
    //= 1.07 Made Pvp Points Configurable
    //= 1.08 Fixed typo in Reset Option
    //= 1.09 Made Amount of pvp points earned configurable
    //= 1.0A Ajusted Spacing for easier reading
    //= 1.0B Added Warp to savepoint on abuse into config
    //= 2.0  (unofficial)Fixed bugs on ranking modification and 
    //		 bitwise permissions
    //= 2.0b minor fix on resetting the ladder
    //= 2.1 tested fix to ladder reset part
    //= 2.3 reset all characters it may be offline or online characters
    //===== Contact Ifo: =========================================
    //= [Stolao] 
    // 	Email: [email protected]
    //= [Happy] 
    // 	Email: http://hercules.ws/board/user/164-happy/
    //============================================================
    prontera,139,174,6	script	PvP Rank	837,{
    	mes "[Ladder Event]";
    OnPvpLadder:
    	mes "Ranking";
    	if(getgmlevel() >= .GM){ 								// Menu Generator for GM and Normal Player
    		set .@i,select("View Ranking:Leave:Reset PVP Stats");
    	} else {  
    		set .@i,select("View Ranking:Leave"); 
    	}
    	switch(.@i) { 											// Where generated menu goes to
    		case 3: 											// DReset PvP Stats
    			mes "Are you sure you want to delete";
    			mes "ALL pvp records?";
    			if(select("No:Yes")==1) close;
    			next;
    			mes "Wait one Moment...";
    			mes ".....";
    			cleararray $TOPPK$[0],0,127; 					// Clears array where top rank char names are stored.
    			cleararray $TOPPK[0],0,127; 					// Clears array where top rank kill count are stored.
    			query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'pl_pkcount'"); // Clears kills saved on character variables (NEW: on all characters it may be online or offline)
    			mes "Cleared pvp data.";
    			close;
    		case 1: 											// View PvP Records
    			for(set .@i,1; .@i <= .MaxPlayers; set .@i,.@i+1){
    				mes (.@i)+": "+ $TOPPK$[.@i] +" with "+ $TOPPK[.@i] +" kills";
    				if((.@i) % 10 == 0){ // A nice way to create multiple pages by 10 ranks
    					if(select("Read More:Leave") == 1){ 
    						next; 
    					} else { 
    						close; 
    					}
    				}
    			}
    		case 2:												// Leave
    			close;
    	}
    close;
    OnPCKillEvent:
    	if(.Options&2 && (agitcheck() || agitcheck2())){ 		// Check to disable during woe
    		end;
    	}
    	if(getgmlevel() <= .GmLvl){
    		if(.Options&1 || strcharinfo(3) == .Map$){		
    			if(.Options&32){ 							// Repeatkill abuse counter
    				for(set .@i,.RepeatCount; .@i > 0; set .@i, .@i-1){
    					set @PKedID[.@i+1], @PKedID[.@i]; 	// Old killedrids moved to upper array elements
    				}			
    				set @PKedID,killedrid; 					// set killedrid to [0] position.				
    				for(set .@i,1; .@i < .RepeatCount; set .@i,.@i + 1){
    					if(@PKedID[0] == @PKedID[.@i]){ 		// check if killerid same as the previously killedrids
    						set .@s, .@s + 1; 					// if all 5 past killedrid are the same then this would become 5 and trigger protection
    					} else {
    						break; 			// else stop checking
    					}
    				}
    			}			
    			if(.@s < .RepeatCount){						// if not abusing kills according to repeatcount
    				set pl_pkcount,pl_pkcount + 1;
    				if(.Options&16) { 
    					set getd(.PointType$),getd(.PointType$) + .PvpEarned; // add points
    				}
    				if(pl_pkcount > $TOPPK[.MaxPlayers]) { // If higher than last ranker
    					for(set .@i,1; .@i <= .MaxPlayers ; set .@i, .@i + 1) { // Reorganize the ranking
    						if (pl_pkcount > $TOPPK[.@i] && !.@newrank) {
    							set .@newrank,.@i;
    						}
    						if (strcharinfo(0) == $TOPPK$[.@i] && .@newrank == .@i) {
    							setarray $TOPPK$[.@i], strcharinfo(0);
    							setarray $TOPPK[.@i], pl_pkcount;
    							set .@newrank,0;
    							break;
    						}
    						if ( strcharinfo(0) == $TOPPK$[.@i] && .@newrank != .@i) {
    							set .@existrank,.@i;
    							break;
    						}
    					}
    					if (.@newrank) {
    						for (set .@e,.MaxPlayers; .@e >= 0 ; set .@e, .@e - 1) {
    							if (.@e < .@existrank) {
    								setarray $TOPPK$[.@e + 1], $TOPPK$[.@e]; // move this ranker backward
    								setarray $TOPPK[.@e + 1], $TOPPK[.@e];
    							}
    							if (.@e == .@newrank) {
    								setarray $TOPPK$[.@e], strcharinfo(0);
    								setarray $TOPPK[.@e], pl_pkcount;
    								if(.Options&4) {
    									announce strcharinfo(0)+"'s rank is now "+(.@e)+"",bc_all;
    								}
    								break;
    							}
    						}
    					}
    					
    				}
    			} else {
    				if(.Options&64) { 
    					warp "Save",0,0; 
    				}	
    			}
    		}
    	}
    	end;
    
    
    
    OnInit:
    	set .GM,99;
    	set .MaxPlayers,10;		// Number of Players held in Records
    	set .GmLvl,99;			// Highest GM level Able to Hold a Record, if Option 8 is Disabled
    	set .Map$,"guild_vs3";		// Map Pvp Must Take Place on in order to Count, if Option 1 is Disabled
    	set .RepeatCount,5;		// Number of kills on same person before it detects abuse, max of 128
    	set .PointType$,"#PvpPoints";	// Name of points earned, E.G. #Cash Points
    	set .PvpEarned,1;		// Number of Pvp Points Earned
    	set .Options,4|32|64;			// Bitwise Variable
    		//   1:  Only Counts Kills on .Map$ if Disabled
    		//   2:  Disables Record Holding during WOE
    		//   4:  Announce When Someone Takes a Rank
    		//   8:  Allow Gms Above level .GmLvl To Be on Ladder
    		//   16: Gain PvP Points on Kills (#PvpPoints)
    		//   32: Repeat Kill Protection
    		//   64: Warp to Save on abuse
    		// Example: "1+2+4 = 7" No Forced Map, Disables Record Holding during WOE and Announces New Record Holders
    	bindatcmd("PvpLadder"	,"Pvp_Ladder::OnPvpLadder",0,99);
    		waitingroom "PvP Rank - ترتيب الشغب",0;
    	end;
    }
    
    pvp_n_1-5	mapflag	nobranch
    pvp_n_1-5	mapflag	novending
    pvp_n_1-5	mapflag	nosave
    pvp_n_1-5	mapflag	nowarp
    pvp_n_1-5	mapflag	novending
    pvp_y_1-2	mapflag	nobranch
    pvp_y_1-2	mapflag	novending
    pvp_y_1-2	mapflag	nosave
    pvp_y_1-2	mapflag	nowarp
    pvp_y_1-2	mapflag	novending
    pvp_y_1-4	mapflag	nobranch
    pvp_y_1-4	mapflag	novending
    pvp_y_1-4	mapflag	nosave
    pvp_y_1-4	mapflag	nowarp
    pvp_y_1-4	mapflag	novending

     

    not work why ?

  2. On 6/29/2018 at 9:23 AM, Inquisitor said:

    i think u can use the this as a template:


    12658,Trans_Scroll_Devi,Transformation Scroll(Deviruchi),2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ transform 1109,1200000,SC_MTF_ASPD,10,5; showscript "Traaaansformation-!! Deviruchi form!!"; },{},{}

    just change the first side of the script to the bodystyle stuff, i actually dont have body style on my local server, so, i can´t really test it, but im pretty sure it will work this way.

    give me an example
     

     

    any help here ?

     

  3. 13 minutes ago, Tyrfing said:

    No.

    You have to decide: do you want to log your GM commands and cash to a text file or to your SQL database?

    If you want to log to a Text File

    1. First, disable SQL logs (conf\log_athena.conf, line 40)

    
    // Use MySQL Logs? [SQL Version Only] (Note 1)
    sql_logs: no

    2. Uncomment the first lines, comment the last ones. (conf\log_athena.conf, line 141)

    
    // Logging files/tables
    // Following settings specify where to log to. If 'sql_logs' is
    // enabled, SQL tables are assumed, otherwise flat files.
    
    log_gm_db: log/atcommandlog.log
    log_branch_db: log/branchlog.log
    log_chat_db: log/chatlog.log
    log_mvpdrop_db: log/mvplog.log
    log_npc_db: log/npclog.log
    log_pick_db: log/picklog.log
    log_zeny_db: log/zenylog.log
    log_cash_db: log/cashlog.log
    log_feeding_db: log/feedinglog.log
    
    //log_gm_db: atcommandlog
    //log_branch_db: branchlog
    //log_chat_db: chatlog
    //log_mvpdrop_db: mvplog
    //log_npc_db: npclog
    //log_pick_db: picklog
    //log_zeny_db: zenylog
    //log_cash_db: cashlog
    //log_feeding_db: feedinglog

    If you want to log to a SQL database

    1. First, enable SQL logs (conf\log_athena.conf, line 40)

    
    // Use MySQL Logs? [SQL Version Only] (Note 1)
    sql_logs: yes

    2. Comment the first lines, uncomment the last ones. (conf\log_athena.conf, line 141)

    
    // Logging files/tables
    // Following settings specify where to log to. If 'sql_logs' is
    // enabled, SQL tables are assumed, otherwise flat files.
    
    // log_gm_db: log/atcommandlog.log
    // log_branch_db: log/branchlog.log
    // log_chat_db: log/chatlog.log
    // log_mvpdrop_db: log/mvplog.log
    // log_npc_db: log/npclog.log
    // log_pick_db: log/picklog.log
    // log_zeny_db: log/zenylog.log
    // log_cash_db: log/cashlog.log
    // log_feeding_db: log/feedinglog.log
    
    log_gm_db: atcommandlog
    log_branch_db: branchlog
    log_chat_db: chatlog
    log_mvpdrop_db: mvplog
    log_npc_db: npclog
    log_pick_db: picklog
    log_zeny_db: zenylog
    log_cash_db: cashlog
    log_feeding_db: feedinglog

     

    SQL database
    I did everything but did not appear in Sql

  4. 11 minutes ago, Tyrfing said:

    rAthena logs these by default at the atcommandlog and cashlog tables.

    You can verify this in conf\log_athena.conf:

    
    // Track Cash Changes
    // 0 - don't log
    // 1 - log any changes
    log_cash: 1
    
    // Log AtCommands & Charcommands (Note 1)
    // Only commands issued by player groups ('conf/groups.conf') with
    // 'log_commands' setting set to 'true' will be logged.
    log_commands: yes
    
    // Logging files/tables
    // Following settings specify where to log to. If 'sql_logs' is
    // enabled, SQL tables are assumed, otherwise flat files.
    log_gm_db: atcommandlog
    log_cash_db: cashlog

     

    like this

    photo_2018-05-26_10-25-45.jpg

  5. //= ---
    //= MvP Rank Improved v1.0
    //= ---
    //= This Rank will count every MvP you kill,
    //= to be more clear, will count every mob
    //= defined inside the array ".mobid[0]",
    //= so, if you add the poring ID will count in the rank
    //= you can modify and ad miniBoss because this array
    //= only have all MvPs, that's the idea, only MvPs...
    //= ---
    
    // --- Re-coded by Cookie ---
    
    
    -	script	Rank MvP	-1,{
    
    OnInit:
    
    
    setarray .mobid[0],1511,1647,1785,1630,1399,1039,1874,2068,1272,1719,1046,1389,1112,1115,1957,1418,1871,1252,1768,1086,1688,1646,1373,1147,1059,1150,1956,2022,1087,1190,1038,1157,1159,1502,1623,1650,1583,1708,1312,1751,1685,1648,1917,1658;
    set .a, 1; // [ 1 - Enable global announcement on MvP kill ] [ 0 - Disable global announcement ]
    set $@top, 10; // Number of top rankings that will be shown.
    end;
    
    OnNPCKillEvent:
    if (getgmlevel() > 10) end;
    
    for (set .@c, 0; .@c < getarraysize(.mobid); set .@c, .@c + 1) { if (killedrid == .mobid[.@c]) set .@s, 1; } // Check MvP
    if (!.@s) end;
    if (.a) announce "قام اللاعب [" +strcharinfo(0) +"] بقتل [" +getmonsterinfo(killedrid,0) +"] فى خريطة [" +strcharinfo(3) +"]",bc_blue|bc_all;
    
    query_sql "SELECT char_id FROM mvp_ranking WHERE char_id = "+getcharid(0),@char_id;
    
    if (@char_id == getcharid(0)) {
    	query_sql "SELECT mvp_count FROM mvp_ranking WHERE char_id = "+getcharid(0),@mvptotal;
    	set @mvptotal, @mvptotal +1;
    	query_sql "UPDATE mvp_ranking SET mvp_count = '"+@mvptotal+"' WHERE char_id = "+getcharid(0);
    	} else {
    	set @mvptotal, 1;
    	query_sql "INSERT INTO mvp_ranking (id,char_id,mvp_count) VALUES ('','"+getcharid(0)+"','"+@mvptotal+"')";
    	}
    	end;
    }
    
    
    // ===== Functions =====
    function	script	mvp_rank	{
        set @mvptotal, getarg(0);
        set @nomb$, getarg(1);
        for (set .@c, 0; .@c < $@top; set .@c, .@c + 1)
        {
            if (@mvptotal >= getd("$topmvp" +.@c))
            {
                if (strcharinfo(0) == getd("$topmvp" +.@c +"$"))
                {
                    setd "$topmvp" +.@c, @mvptotal;
                    setd "$topmvp" +.@c +"$", @nomb$;
                    return;
                }
                else
                {
                    if (getd("$topmvp" +(.@c + 1) +"$") == "")
                    {
                        setd "$topmvp" +.@c, @mvptotal;
                        setd "$topmvp" +.@c +"$", @nomb$;
                        return;
                    }
                    else
                    {
                        setd "$topmvp" +(.@c + 1), getd("$topmvp" +.@c);
                        setd "$topmvp" +(.@c + 1) +"$", getd("$topmvp"+.@c+"$");
                        setd "$topmvp" +.@c, @mvptotal;
                        setd "$topmvp" +.@c +"$", @nomb$;
                        return;
                    }
                }
            }
        }
    	return;
    }
    
    // ===== Script ======
    -	script	Rank MvP	-1,{
    	OnInit:
            // Set npc-specific variables
            setarray .mobid[0],1511,1647,1785,1630,1399,1039,1874,2068,1272,1719,1046,1389,1112,1115,1957,1418,1871,1252,1768,1086,1688,1646,
            1373,1147,1059,1150,1956,2022,1087,1190,1038,1157,1159,1502,1623,1650,1583,1708,1312,1751,1685,1648,1917,1658,2362,1832,1885,1373,1251,1492; // MvP Ids
            set .a, 0; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
            set $@top, 10; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
            end;
    
    	OnNPCKillEvent: // Script execution
            for (set .@c, 0; .@c < getarraysize(.mobid); set .@c, .@c + 1)
            {
            	if (killedrid == .mobid[.@c])
                {
            		set .@s, 1; // If a MvP
    			}
    		}
            if (!.@s) // Indicates if not a MVP; if so, end script execution.
            	end;
            if (.a) // If announcement is toggled, execute broadcast.
    			announce "The user [" +strcharinfo(0) +"] has killed a [" +getmonsterinfo(killedrid,0) +"] in the map [" +strcharinfo(3) +"]",bc_blue|bc_all;
            set MvP, MvP + 1;
            mvp_rank(MvP,strcharinfo(0));
            end;
    }
    
    prontera,139,171,6	script	MvP Rank	661,{
    	
    waitingroom "MVP Ranking",0;
    
    
        function	checkPerm;
        // Check GM level;
        if (checkPerm())
        {
        	set .@sel, select ("Show Ranking:^FF0000Reset MVP Ranking^000000");
            if (.@sel == 2)
            { // Reset Ranking
            	mes .npcname$;
                mes "Are you sure you would like to reset the MVP Ranking?";
                next;
                set .@confirm, select ("Confirm:Cancel");
                if (.@confirm == 1)
                {
                	for (set .@i, 0; .@i < $@top; set .@i, .@i + 1)
                    {
                    	setd "$topmvp" +.@i, 0;
                        setd "$topmvp" +.@i +"$", "";
                    }
                    mes .npcname$;
                    mes "The Ranking has been reset.";
                    close;
                    end;
    			}
    			else
    			{
    				close;
    				end;
    			}
            }
        }
    	mes .npcname$;
    	for (set .@c, 0; .@c < $@top; set .@c, .@c + 1)
    	{
    		mes "#^FF0000" +(.@c + 1) +"^000000 [ ^0000FF" +getd("$topmvp" +.@c +"$") +"^000000 ] with ^FF0000" +getd("$topmvp" +.@c) +"^000000 MvP killed.";
    	}
    	close;
        end;
        
        // =========================
        // ===== Configuration =====
        // =========================
        OnInit:
        	set .npcname$, "[ MvP Rankings ]";
        	setarray .gm_perm[0],99; // Set all of the GMs that can access this
            end;
        
        function	checkPerm	{
        	for (set .@i, 0; .@i < getarraysize(.gm_perm); set .@i, .@i + 1)
            {
            	if (getgmlevel() >= .gm_perm[.@i]) // Change this to >= or == dependent on if you're specifically wanting to set individual GM levels (==) or hierarchy (>=)
                	return 1;
            }
            return 0;
        }
    }
    

    I need help
    I want to make the script delete the rank of players if online or offline
    When I delete, only the connected players are deleted

  6. When rearranging the connected players are deleted from the list only,
    if the players are offline, they do not delete
    any help?
     
     
     
     
    //===== Stolao Scripts ================================== 
    //= PvP Ladder
    //===== Author ================================================== 
    //= Stolao (Original Author)
    //= Happy (2.0)
    //===== Current Version: ===================================== 
    //= 2.0(unofficial)
    //===== Compatible With: ===================================== 
    //= rAthena SVN, Hercules, 3ceam, eAthena
    //===== Description: =========================================
    // Configurable Pvp Ladder
    //===== Comments: ============================================
    //= [Stolao]
    //  Needs bug testing, please report any bugs
    //  Unable to test thurally on my comp atm
    //= [Happy]
    //  Update* I tested it and found tons of bugs, I'm in rush so 
    //  I fixed them myself. It is now working 100%. 
    //  The version is unofficial version. Sorry Stolao I fixed it
    //  Without your permission XD
    //===== Additional Comments: =================================
    //= 1.00 Initial Release
    //= 1.01 Added Location with veiwing of ladder
    //= 1.02 Added GM Menu
    //= 1.03 Added atcommand
    //= 1.04 Shortend menu script
    //= 1.05 Added PvpPoints into confug and script
    //= 1.06 Added Abuse Protection
    //= 1.07 Made Pvp Points Configurable
    //= 1.08 Fixed typo in Reset Option
    //= 1.09 Made Amount of pvp points earned configurable
    //= 1.0A Ajusted Spacing for easier reading
    //= 1.0B Added Warp to savepoint on abuse into config
    //= 2.0  (unofficial)Fixed bugs on ranking modification and 
    //		 bitwise permissions
    //= 2.0b minor fix on resetting the ladder
    //= 2.1 tested fix to ladder reset part
    //===== Contact Ifo: =========================================
    //= [Stolao] 
    // 	Email: [email protected]
    //= [Happy] 
    // 	Email: http://hercules.ws/board/user/164-happy/
    //============================================================
    prontera,139,174,6	script	PvP Rank	837,{
    	mes "[Ladder Event]";
    OnPvpLadder:
    	mes "Ranking";
    	if(getgmlevel() >= .GM){ 								// Menu Generator for GM and Normal Player
    		set .@i,select("View Ranking:Leave:Reset PVP Stats");
    	} else {  
    		set .@i,select("View Ranking:Leave"); 
    	}
    	switch(.@i) { 											// Where generated menu goes to
    		case 3: 											// DReset PvP Stats
    			mes "Are you sure you want to delete";
    			mes "ALL pvp records?";
    			if(select("No:Yes")==1) close;
    			next;
    			mes "Wait one Moment...";
    			mes ".....";
    			cleararray $TOPPK$[0],0,127; 					// Clears array where top rank char names are stored.
    			cleararray $TOPPK[0],0,127; 					// Clears array where top rank kill count are stored.
    			query_sql("DELETE FROM `char_reg_num_db` WHERE `key` = 'pl_pkcount'"); // Clears kills saved on character variables
    			set .@self, getcharid(3); 						// Remembers RID of current char talking to npc
    			set .@size, query_sql("select account_id from `char` where online = 1", .@aid);
    			for(set .@i,0; .@i<.@size; set .@i,.@i+1) {		// Deletes kills of online players
    				if(attachrid(.@aid[.@i])){ 					//attach rid of online player 1 by 1 and remove kills
    					set pl_pkcount,0;
    				}	
    			}
    			attachrid(.@self); 								// attach remembered rid back
    			mes "Cleared pvp data.";
    			close;
    		case 1: 											// View PvP Records
    			for(set .@i,1; .@i <= .MaxPlayers; set .@i,.@i+1){
    				mes (.@i)+": "+ $TOPPK$[.@i] +" with "+ $TOPPK[.@i] +" kills";
    				if((.@i) % 10 == 0){ // A nice way to create multiple pages by 10 ranks
    					if(select("Read More:Leave") == 1){ 
    						next; 
    					} else { 
    						close; 
    					}
    				}
    			}
    		case 2:												// Leave
    			close;
    	}
    close;
    OnPCKillEvent:
    	if(.Options&2 && (agitcheck() || agitcheck2())){ 		// Check to disable during woe
    		end;
    	}
    	if(getgmlevel() <= .GmLvl){
    		if(.Options&1 || strcharinfo(3) == .Map$){		
    			if(.Options&32){ 							// Repeatkill abuse counter
    				for(set .@i,.RepeatCount; .@i > 0; set .@i, .@i-1){
    					set @PKedID[.@i+1], @PKedID[.@i]; 	// Old killedrids moved to upper array elements
    				}			
    				set @PKedID,killedrid; 					// set killedrid to [0] position.				
    				for(set .@i,1; .@i < .RepeatCount; set .@i,.@i + 1){
    					if(@PKedID[0] == @PKedID[.@i]){ 		// check if killerid same as the previously killedrids
    						set .@s, .@s + 1; 					// if all 5 past killedrid are the same then this would become 5 and trigger protection
    					} else {
    						break; 			// else stop checking
    					}
    				}
    			}			
    			if(.@s < .RepeatCount){						// if not abusing kills according to repeatcount
    				set pl_pkcount,pl_pkcount + 1;
    				if(.Options&16) { 
    					set getd(.PointType$),getd(.PointType$) + .PvpEarned; // add points
    				}
    				if(pl_pkcount > $TOPPK[.MaxPlayers]) { // If higher than last ranker
    					for(set .@i,1; .@i <= .MaxPlayers ; set .@i, .@i + 1) { // Reorganize the ranking
    						if (pl_pkcount > $TOPPK[.@i] && !.@newrank) {
    							set .@newrank,.@i;
    						}
    						if (strcharinfo(0) == $TOPPK$[.@i] && .@newrank == .@i) {
    							setarray $TOPPK$[.@i], strcharinfo(0);
    							setarray $TOPPK[.@i], pl_pkcount;
    							set .@newrank,0;
    							break;
    						}
    						if ( strcharinfo(0) == $TOPPK$[.@i] && .@newrank != .@i) {
    							set .@existrank,.@i;
    							break;
    						}
    					}
    					if (.@newrank) {
    						for (set .@e,.MaxPlayers; .@e >= 0 ; set .@e, .@e - 1) {
    							if (.@e < .@existrank) {
    								setarray $TOPPK$[.@e + 1], $TOPPK$[.@e]; // move this ranker backward
    								setarray $TOPPK[.@e + 1], $TOPPK[.@e];
    							}
    							if (.@e == .@newrank) {
    								setarray $TOPPK$[.@e], strcharinfo(0);
    								setarray $TOPPK[.@e], pl_pkcount;
    								if(.Options&4) {
    									announce strcharinfo(0)+"'s rank is now "+(.@e)+"",bc_all;
    								}
    								break;
    							}
    						}
    					}
    					
    				}
    			} else {
    				if(.Options&64) { 
    					warp "Save",0,0; 
    				}	
    			}
    		}
    	}
    	end;
    
    
    
    OnInit:
    	set .GM,99;
    	set .MaxPlayers,10;		// Number of Players held in Records
    	set .GmLvl,99;			// Highest GM level Able to Hold a Record, if Option 8 is Disabled
    	set .Map$,"guild_vs3";		// Map Pvp Must Take Place on in order to Count, if Option 1 is Disabled
    	set .RepeatCount,5;		// Number of kills on same person before it detects abuse, max of 128
    	set .PointType$,"#PvpPoints";	// Name of points earned, E.G. #Cash Points
    	set .PvpEarned,1;		// Number of Pvp Points Earned
    	set .Options,4|32|64;			// Bitwise Variable
    		//   1:  Only Counts Kills on .Map$ if Disabled
    		//   2:  Disables Record Holding during WOE
    		//   4:  Announce When Someone Takes a Rank
    		//   8:  Allow Gms Above level .GmLvl To Be on Ladder
    		//   16: Gain PvP Points on Kills (#PvpPoints)
    		//   32: Repeat Kill Protection
    		//   64: Warp to Save on abuse
    		// Example: "1+2+4 = 7" No Forced Map, Disables Record Holding during WOE and Announces New Record Holders
    	bindatcmd("PvpLadder"	,"Pvp_Ladder::OnPvpLadder",0,99);
    		waitingroom "PvP Rank - ترتيب الشغب",0;
    	end;
    }
    
    pvp_n_1-5	mapflag	nobranch
    pvp_n_1-5	mapflag	novending
    pvp_n_1-5	mapflag	nosave
    pvp_n_1-5	mapflag	nowarp
    pvp_n_1-5	mapflag	novending
    pvp_y_1-2	mapflag	nobranch
    pvp_y_1-2	mapflag	novending
    pvp_y_1-2	mapflag	nosave
    pvp_y_1-2	mapflag	nowarp
    pvp_y_1-2	mapflag	novending
    pvp_y_1-4	mapflag	nobranch
    pvp_y_1-4	mapflag	novending
    pvp_y_1-4	mapflag	nosave
    pvp_y_1-4	mapflag	nowarp
    pvp_y_1-4	mapflag	novending
    

     

×
×
  • Create New...