Jump to content

darking123

Members
  • Posts

    931
  • Joined

  • Last visited

Posts posted by darking123

  1. May I request for the reward to be changed to #bgpoints instead of item rewards.

     

    //===== rAthena Script =======================================
    //= Rune War - (from Ragnarok Event v2)
    //===============  by: =============================
    //= pajodex
    //===== Current Version: =====================================
    //= 1.0
    //===== Compatible With: =====================================
    //= rAthena Project (pajodex)
    //===== Description: =========================================
    /*
    Rune War (from Ragnarok Event v2)
    		
    	Battleground script that runs OnClockxxxx time on server.
    An npc will appear at prontera for registration. After some time
    RegistrationNPC will disappear. All registered players will
    be divided into 2 teams.
    
    	Players have to eliminate the enemy to gain points. Team
    with the most points accumulated wins.
    
    	A rune will be spawned at the center of the map. Runes similar
    to Dota 2.
    
    	* disclaimer * this runs like the War Over Rune but it is
    my own version. Since this is free, i did not add any special
    features. 
    
     
    	Enjoy!
    
    */
    //=====******** Note ********=================================
    //= if you find bugs or problem, please do tell DM me at
    //= Discord (pajodex#1328) or rAthena (pajodex) 
    //= open for suggestions
    //===== Additional Comments: =================================
    /* 	
    	1.0 - Initial release
    */
    //=============================================================
    
    function	script	F_ShuffleNumbers	{
    	deletearray getarg(2);
    	.@static = getarg(0);
    	.@range = getarg(1) +1 - .@static;
    	.@count = getarg(3, .@range);
    	if (.@range <= 0 || .@count <= 0)
    		return 0;
    	if (.@count > .@range)
    		.@count = .@range;
    	for (.@i = 0; .@i < .@range; ++.@i)
    		.@temparray[.@i] = .@i;
    	for (.@i = 0; .@i < .@count; ++.@i) {
    		.@rand = rand(.@range);
    		set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static;
    		.@temparray[.@rand] = .@temparray[--.@range];
    	}
    	return .@count;
    }
    
    prt_are01,150,150,0	script	Rune#11	100,1,1,{
    end;
    
    OnStart:
    	.rune = rand(1,5);
    	if(!checkre(0))
    		setnpcdisplay strnpcinfo(3), .npc_view_re[.rune];
    	else
    		setnpcdisplay strnpcinfo(3), .npc_view_pre[.rune];
    	end;
    
    OnTouch:
    	if( getvariableofnpc( .start, "runewar#main" ) == 1 ) {
    		if(!.getrune) {
    			if(.rune == 1) {
    				skill "AS_CLOAKING",10,1;
    				sc_start SC_CLOAKING, (.duration * 1000), 10;
    				specialeffect2 120;
    			}
    			if(.rune == 2) {
    				sc_start SC_SPEEDUP0,(.duration * 1000),25;
    				specialeffect2 507;
    			}
    			if(.rune == 3) {
    				sc_start SC_INCATKRATE,(.duration * 1000), 100; 
    				sc_start SC_INCMATKRATE,(.duration * 1000), 100;
    				specialeffect2 220;
    			}
    			if(.rune == 4) {
    				getmapxy( .@map$,.@x,.@y,0,strcharinfo(0) );
    				clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
    				clone .@map$,.@X,.@y,"",getcharid(0),getcharid(0),"",1,.duration;
    				specialeffect2 65;
    			}
    			if(.rune == 5) {
    				sc_start4 SC_REGENERATION,(.duration * 1000),-10,1,0,0;
    				percentheal 10, 0;
    				specialeffect2 EF_HEAL;
    			}
    			mapannounce strnpcinfo(4), strcharinfo(0)+ " has picked up ["+.Rune$[.rune]+"] rune.", bc_blue;
    			setnpcdisplay strnpcinfo(3), HIDDEN_WARP_NPC;
    			.getrune = 1;
    			attachnpctimer;
    			initnpctimer;
    		}
    	}
    	end;
    	
    OnTimer6000:
    	sc_end SC_CLOAKING;
    	sc_end SC_REGENERATION;
    	end;
    	
    OnTimer60000:
    	.countTimer++;
    	if(.countTimer == .respawn_time) {
    		stopnpctimer;
    		detachnpctimer;
    		.rune = rand(1,5);
    		.countTimer = .getrune = 0;
    		if(!checkre(0))
    			setnpcdisplay strnpcinfo(3), .npc_view_re[.rune];
    		else
    			setnpcdisplay strnpcinfo(3), .npc_view_pre[.rune];
    	}
    	setnpctimer 0;	
    	end;
    	
    OnInit:
    	// =============
    	// Rune Settings
    	// =============
    	
    	// Rune names (in-order)
    	setarray .Rune$[1], 
    		"Invisibility", 
    		"Haste",
    		"Double Damage",
    		"Illusion",
    		"Regeneration";
    	
    	// NPC View ID if server in renewal mode
    	setarray .npc_view_re[1], 
    		2450, 
    		2696,
    		2697,
    		2702,
    		2703;
    	
    	// NPC View ID if server in pre-renewal mode	
    	setarray .npc_view_pre[1], 
    		1120, 
    		1096,
    		1582,
    		1388,
    		1031;
    		
    	// Rune effect duration (seconds)
    	.duration = 20; 
    	
    	// Respawn time of rune after being pick-ed up (minutes)
    	.respawn_time = 1; 
    	
    	// disable npc on start of server
    	disablenpc "Rune#11";
    	end;
    }
    
    prt_are01,0,0,0	script	runewar#main	100,{
    OnInit:
    	// =============
    	// Game Settings
    	// =============
    	
    	// How many players to start?
    	// default = 4 (2v2)
    	.minplayers = 4;
    	
    	// How long, in mins, for players to register_time
    	// default = 3 mins
    	.register_time = 3;
    	
    	// How many mins before rune is spawned
    	// default : 1 min
    	.runespawn = 1;
    	
    	// Event duration in minutes..
    	// default : 10 mins
    	.duration = 10; 
    	
    	// Reward settings
    	setarray .rwd[0],
    		501, 10,	// win team reward
    		501, 5;		// lose team reward
    	
    	disablenpc "rwr";
    	setwall strnpcinfo(4), 210, 151, 4, 4, 0, "RWarWall#1";
    	setwall strnpcinfo(4), 89, 151, 4, 4, 0, "RWarWall#2";
    	bindatcmd "startrune",strnpcinfo(3)+"::OnAtCmd",0,60;
    	end;
    	
    // OnClock timers
    OnClock0000:
    OnClock0300:
    OnClock0600:
    OnClock0900:
    OnClock1200:
    OnClock1500:
    OnClock1800:
    OnClock2100:
    OnAtCmd:
    	if( .start == 1 ) end;
    	announce "[ Rune War ] : Registration will start in 3 mins.",0;
    	sleep 6000;
    	announce "[ Rune War ] : Registration will start in 2 mins.",0;
    	sleep 6000;
    	announce "[ Rune War ] : Registration will start in 1 min.",0;
    	sleep 6000;
    	announce "[ Rune War ] : You may now proceed to prontera if you want to join.",0;
    	enablenpc "rwr";
    	announce "[ Rune War ] : Registration ends in "+ .register_time +" mins.",0;
    	sleep .register_time * 60000;
    	if( getvariableofnpc(.size, "rwr") < .minplayers ) {
    		announce "[ Rune War ] : Too few players registered.",0;
    		sleep 5000;
    		announce "[ Rune War ] : Terminating event.",0;
    		end;
    	}
    	else
    		donpcevent "rwr::OnStart";
    	announce "[ Rune War ] : Rune War will start in a few moment.",0;
    	end;
    	
    OnStart:
    	.start = 1;
    	sleep 5000;
    	disablenpc "rwr";
    	.red = bg_create ( strnpcinfo(4), 251, 149, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDie" );
    	.blue =  bg_create ( strnpcinfo(4), 47, 149, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDie" ); 
    	callfunc "F_ShuffleNumbers", 0, getarraysize(.aid_)-1, .@r;
    	for ( .@i = 0; .@i < getarraysize(.aid_); ++.@i ) {
    		attachrid .aid_[.@r[.@i]];
    		bg_join ( .@i % 2 )? .red : .blue;
    	}
    	detachrid;
    	sleep 1000;
    	announce "Kill as much enemy as you can to earn points.", bc_npc | bc_map | bc_blue;
    	sleep 1000;
    	announce "Team who gains most points until event ends wins.", bc_npc | bc_map | bc_blue;
    	sleep 1000;
    	announce "Start battle!", bc_npc | bc_map | bc_blue;
    	bg_warp .red, strnpcinfo(4),200,150;
    	bg_warp .blue, strnpcinfo(4),100,150;
    	
    	sleep .runespawn * 60000;
    	
    	enablenpc "Rune#11";
    	donpcevent "Rune#11::OnStart";
    	announce "A Power Rune has spawn at the center of the map.", bc_npc | bc_map | bc_blue;
    	
    	sleep ( .duration - .runespawn ) * 60000;
    	
    	if( .redpoints > .bluepoints )
    		callsub L_reward, .red, .blue, "Red";
    	else if( .bluepoints > .redpoints )
    		callsub L_reward, .blue, .red, "Blue";
    	else if( .bluepoints = .redpoints )
    		announce "Battle ended up with a tie!", bc_npc | bc_map | bc_blue;
    	mapwarp strnpcinfo(4),"prontera",150,180,0;
    	.redpoints = .bluepoints = .start = 0;
    	bg_updatescore strnpcinfo(4), 0, 0;
    	bg_destroy .red;
    	bg_destroy .blue;
    	disablenpc "Rune#11";
    	end;
    	
    L_reward:
    	announce getarg(2) +" team has won!", bc_npc | bc_map | bc_blue;
    	bg_get_data getarg(0), 1;
    	for ( .@i = 0; .@i < $@arenamemberscount; ++.@i )
    		getitem .rwd[0],.rwd[1], $@arenamembers[.@i];
    	sleep 1;
    	bg_get_data getarg(1), 1;
    	for ( .@i = 0; .@i < $@arenamemberscount; ++.@i )
    		getitem .rwd[2],.rwd[3], $@arenamembers[.@i];
    	return;
    	
    OnRedQuit: callsub L_Quit, .red, "Red";
    OnBlueQuit: callsub L_Quit, .blue, "Blue";
    L_Quit:
    	if ( bg_get_data( getarg(0), 0 ) ) end;
    	announce "All "+ getarg(2) +" team members has Quit!", bc_npc | bc_map | bc_blue;
    	sleep 1000;
    	callsub L_reward, ( getarg(0) == .red ) ? .red : .blue, ( getarg(0) == .red ) ? .blue : .red, ( getarg(0) == .red ) ? "Red" : "Blue";
    	awake instance_npcname( strnpcinfo(0) );
    	end;
    
    OnRedDie: callsub L_die, "Red";
    OnBlueDie: callsub L_die, "Blue";
    L_die:
    	if( getcharid(4) == .red)
    		++.bluepoints;
    	else if( getcharid(4) == .blue)
    		++.redpoints;
    	bg_updatescore strnpcinfo(4), .redpoints, .bluepoints;
    	announce getarg(0) +" team member has died!", bc_npc | bc_map | bc_blue;
    	sleep2 1250;
    	percentheal 100, 100;
    	sleep2 5000;
    	warp strnpcinfo(4), ( getcharid(4) == .red ) ? 200 : 100, 150;
    	end;
    }
    prontera,150,185,0	script	Rune War Register::rwr	100,{
    	.@name$ = strcharinfo(0);
    	.@start = getvariableofnpc(.start, "runewar#main"); 
    	if(.@start == 1) {
    		mes "Sorry, event is on-going.";
    		close;
    	}
    	mes "Do you want to join the queue?";
    	next;
    	while ( .aid[.@i] != getcharid(3) && .@i < .size ) ++.@i;
    	if ( .@i < .size ) {
    		mes "You already join the queue.";
    		close;
    	}
    	select "Join";
    	mes "You have to stay to this map";
    	close2;
    	.aid[ .size++ ] = getcharid(3);
    	for ( .@i = 0; .@i < .size; ++.@i ) {
    		if ( !isloggedin( .aid[.@i] ) ) {
    			deletearray .aid[.@i], 1;
    			--.@i;
    			--.size;
    		}
    		else {
    			attachrid .aid[.@i];
    			if ( strcharinfo(3) != strnpcinfo(4) ) {
    				deletearray .aid[.@i], 1;
    				--.@i;
    				--.size;
    			}
    		}
    	}
    	detachrid;
    		announce .@name$ +" has  joined Rune War.", bc_npc | bc_area | bc_blue;
    	end;
    	
    OnStart:
    	copyarray getvariableofnpc( .aid_, "runewar#main" ), .aid, .size;
    	donpcevent "runewar#main::OnStart";
    	deletearray .aid;
    	.size = 0;
    	end;
    }
    
    prt_are01	mapflag	battleground	2
    

     

  2. How to disable "send a mail". It is using rodex. Thank you!

    image.png.fcaf76a26ab0d59a9c35ecc2103a9393.png

    agree with this part. you may hide the button via diff. however rodex can still be used with the above screenshot.

     

    disregard above. just modified my mail.cpp instead

  3. Upon checking when a user warps or use flywing on the same map. the addtimer resets.

     

    Is there a way to check if the user already has addtimer attached already to prevent addtimer from triggering again? Thank you!

     

    OnPCLoadMapEvent:
    	deltimer strnpcinfo(0)+"::OnCheat";
    	deltimer strnpcinfo(0)+"::OnTrig";
    	for (.@a = 0; .@a < getarraysize(.arrayt_maps1$); set .@a,.@a+1) {
    	if ( strcharinfo(3) == .arrayt_maps1$[.@a]) {
    	addtimer 900000, strnpcinfo(3)+"::OnTrig"; 
    	end;
    	}
    }


     

  4. 4 hours ago, TheKingDino said:

    I can't remember if SA_MONOCELL has something to do with summons.

    SA_CLASSCHANGE is the one that transforms a monster iirc. Try removing these:

     

    
     - Skill: SA_CLASSCHANGE
        Probability:
          - Level: 5
            Probability: 10
          - Level: 6
            Probability: 10
          - Level: 7
            Probability: 20
          - Level: 8
            Probability: 20
          - Level: 9
            Probability: 30
          - Level: 10
            Probability: 30
      - Skill: SA_SUMMONMONSTER
        Probability:
          - Level: 1
            Probability: 100
          - Level: 2
            Probability: 200
          - Level: 3
            Probability: 300
          - Level: 4
            Probability: 400
          - Level: 5
            Probability: 500
          - Level: 6
            Probability: 600
          - Level: 7
            Probability: 700
          - Level: 8
            Probability: 800
          - Level: 9
            Probability: 900
          - Level: 10
            Probability: 1000

    and this
     

    
      - Skill: SA_MONOCELL

     

    Removed those. However it seems that the skill still summons random monster.

  5. 17 hours ago, JulioFortunato said:

    I'm having this same issue.

    On first vote it works fine, but after the interval period, it just redirects to the vote site listing.

    I've attached a video to this post.

    Any clues on this? @Sanasol @kitty14

     

    Thanks!

    I am not sure, there are issue currently on that. It updates the logs file however it does it continue with the statement, so I end up modifying the query instead. 

  6. 33 minutes ago, HaureN said:

    let me see if i get it, you want to player be teleported to a specific location when jail is over?

    u can use part of @go command (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L1939)

    
    if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == SETPOS_OK) {
    	clif_displaymessage(fd, msg_txt(sd,0)); // Warped.
    }

    in @unjail (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L4957)

    
    //Reset jail time to 1 sec.
    sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
    clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
    clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
    return 0;

    i'm not sure but would be something like that(?)

    
    //Reset jail time to 1 sec.
    pc_setpos(sd, mapindex_name2id(prontera), 150, 150, CLR_TELEPORT); // really not sure
    sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
    clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
    clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
    return 0;

     

    thank you for your response however that is not working. It just teleport the player back to his original position.

    I think it is something to do with how SC_JAILED bahave. hmm.

  7. 13 hours ago, enfokan2rd said:

     

    thank you very much I put it but it does not work I am new to these things I could prepare myself in a txt file, If you do not mind

     

    you have to test what @Emistry provided. just add your likings. here is an example. 

     

    type commands @mall,@market,@turbo_room then it will warp you to turbo_room with the x and y coordinates 99,111

     

    -	script	go_mall	-1,{
    OnInit:
    	bindatcmd "mall",strnpcinfo(3)+"::Ongomallcom";
    	bindatcmd "market",strnpcinfo(3)+"::Ongomallcom";
    	bindatcmd "turbo_room",strnpcinfo(3)+"::Ongomallcom";
    	end;
    Ongomallcom:
    	warp "turbo_room",99,111;
    	end;
    }

     

×
×
  • Create New...