Jump to content

Athan17

Members
  • Posts

    57
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Athan17

  1. Untested, basically this is the idea taken from the current rathena docs and item_db.txt
    If something doesn't work, you can easily check which one didn't work.
    
    item_db
    2357 {
    bonus bAllStats,3; 
    bonus bUnbreakableArmor;
    }
    
    2524 {
    bonus bUnbreakableGarment;
    if(BaseClass==Job_Mage||BaseClass==Job_Archer||BaseClass==Job_Acolyte) bonus bFlee2,3+(getequiprefinerycnt(EQI_GARMENT)*2); 
    else if(BaseClass==Job_Swordman||BaseClass==Job_Merchant||BaseClass==Job_Thief) bonus bShortWeaponDamageReturn,3+(getequiprefinerycnt(EQI_GARMENT)*2);
    }
    
    2421 {
    bonus2 bResEff,Eff_Sleep,100;  
    bonus bMaxHPrate,15;
    bonus bMaxSPrate,15;
    bonus bMdef,5;
    .@r = getequiprefinerycnt(EQI_SHOES); 
    if(.@r > 5) bonus bMaxHPrate,2*.@r;
    if(.@r > 5) bonus bMaxSPrate,2*.@r;
    bonus bSpeedRate,25;
    bonus bUnbreakableShoes;
    }
    
    2115 {
    bonus2 bSubEle,Ele_Water,10;
    bonus2 bSubEle,Ele_Fire,10;
    bonus2 bSubEle,Ele_Dark,10;
    bonus2 bSubEle,Ele_Undead,10;
    bonus bMdef,5;
    bonus2 bSubEle,Ele_Neutral,5;
    }
    
    
    item_combo_db
    2357:2524:2421, {
    bonus bMaxHPrate,10;
    bonus bMaxSPrate,10;
    bonus bAtkRate,3;
    bonus bMatkRate,3;
    bonus bMaxHPrate,(getequiprefinerycnt(EQI_ARMOR)/2);
    }
    
    
    Source: 
    https://raw.githubusercontent.com/rathena/rathena/master/db/re/item_db.txt
    https://github.com/rathena/rathena/blob/master/db/re/item_combo_db.txt
    Docs:
    https://github.com/rathena/rathena/blob/master/doc/item_db.txt
    https://github.com/rathena/rathena/blob/master/doc/item_bonus.txt
    

     

  2. check how lhz_dun03 and lhz_dun04 bosses are spawned.

    well, base on your script, looks like you kill the mvp every 10mins?
    i have two solutions for you, coz im not sure if you want to retain that every 10 mins of spawn.
    first solution would be, make an npc variable that will be set to "true" when is spawned and set to "false" when mvp died.
     

    OnInit:
    set .isMonAlive, 0; // not alive
    ...
    OnMinute00:
    OnMinute10:
    OnMinute20:
    OnMinute30:
    OnMinute40:
    OnMinute50:
    if(.isMonAlive) end; // checks if monster still alive, do not run the script.
    ... //after calling monster
    .isMonAlive = 1; // set to 1 because monster spawned
    
    ...
    OnBossMvPKilled:
    .isMonAlive = 0; // after mvp died, set 0, means its dead.


    then, 2nd solution would be, spawn a random monster every 10 mins, this works like lhz_dun03/04
     

    OnInit: // spawn monster on init
    OnTimer60000: //not sure if 10mins or 1hr, check docu
    //call random monster with ::OnBossMvpDead
    ...
    end;
    
    OnBossMvpDead:
    initnpctimer;
    end;

     

    • Upvote 1
  3. in skill_db.txt

    //id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,inf3,name,description
    
    where
    // 04 inf (0- passive, 1- enemy, 2- place, 4- self, 16- friend, 32- trap)

    therefore:

    402,9,6,1,0,0x1,0,5,1,no,0,0,0,none,0,0x0,		PF_MINDBREAKER,Mind Breaker
    to
    402,9,6,21,0,0x1,0,5,1,no,0,0,0,none,0,0x0,		PF_MINDBREAKER,Mind Breaker // can target enemy, self and friends/party

     

    • Upvote 1
  4. On 1/8/2017 at 11:46 AM, Bringer said:

    1st Code Where i can find it?

    its in skill.c
    Text editing softwares has a powerful tool called "Search", and most of them are toggled by hitting CTRL+F.
     

    On 1/8/2017 at 11:46 AM, Bringer said:

    or can you combine the code for me ? 

     

    On 1/7/2017 at 11:51 PM, Playtester said:

    With that info you should be able to code it together yourself.



    and also, why not just grant the skill Clementia and Canto Candidus when Soul Linked? It will be easier than modifying the source.. if you dont know what're doing (since you asked, seems like it)

    since Agi/Bless is a target skill while Clem/Canto is a self skill, you might not get the effect you'd wanted (being the agi/bless transforms from target skill to self skill when soul linked). perhaps separating them is a better approach.

  5. // set each class with itemid.
    set .rewardperclass[1], 4276; // Swordsman
    set .rewardperclass[3], 4525; // Archer
    set .rewardperclass[2], 4386; // Mage
    set .rewardperclass[4], 4372; // Acolyte
    set .rewardperclass[5], 4,342; // Merchant
    set .rewardperclass[6], 4168; // Thief
    set .rewardperclass[4046], 4425; // Taekwon
    set .rewardperclass[0], 4123; // Super Novice
    set .rewardperclass[24], 4324; // Gunslinger
    set .rewardperclass[25], 4134; // Ninja
    // you can also use script constants like JOB_RUNE_KNIGHT, JOB_HIGH_PRIEST on arrays more info at src/map/script_constants.h
    
    // then use the variable like this:
    // .rewardperclass[BaseClass]
    // if you want to get specific class like Lord Knight, Paladin etc, then use [Class] instead of [BaseClass], and edit the class ids on array.
    
    // for limited time items, use rentitem
    rentitem .rewardperclass[BaseClass],32000; // 320000 is one day?

     

  6. 3 minutes ago, saovarott159 said:

    Thank you so much

    But don,t work (Bug in Picture)

    112233.JPG

    haha i thought so, here's an update regarding bug check. sorry i cant test it in office.
     

    // Reset Position In-game version
    
    prontera,160,160,4	script	Position Reset	909,{
    	mes "[System]";
    	mes "Please select a character";
    	mes "return to save point...";
    	set .@count, query_sql("SELECT `char_id`,`name` FROM `char` WHERE `account_id` = "+getcharid(3),.@charid,.@charname$);
    	set .@menu$, "";
    
    	for ( set @ctr,0; @ctr < .@count; @ctr++ )
    		.@menu$ = .@menu$ + .@charname$[@ctr]+":";
    	.@menu = .@menu$ + "Cancel";
    
    	set .@selectedchar, select(.@menu$)-1;
    	next;
    
    	if( .@selectedchar < .@count )
    	{
    		if( getcharid(0) != .@charid[.@selectedchar] )
    		{
    			query_sql("UPDATE `char` AS ch SET ch.last_map = ch.save_map, ch.last_x = ch.save_x, ch.last_y = ch.save_y WHERE ch.char_id = "+.@charid[.@selectedchar]);
    			mes .@charname$[@selectedchar] + "'s position has been reset.";
    		}
    		else
    		{
    			// TODO: instead of having if-else, its better not to show the invoker's name in selection.
    			mes "you cant reset your own position";
    		}
    	}
    	end;
    }

     

    • Upvote 1
  7. made this script few hours ago, but im too scared to post it, might have a lot of bugs on it coz didnt tested it yet.

    // Reset Position In-game version
    
    prontera,160,160,4	script	Position Reset	909,{
    	mes "[System]";
    	mes "Please select a character";
    	mes "return to save point...";
    	set .@count, query_sql("SELECT `char_id`,`name` FROM `char` WHERE `account_id` = "+getcharid(3),.@charid,.@charname$);
    	set .@menu$, "";
    
    	for ( set @ctr,0; @ctr < .@count; @ctr++ )
    		.@menu$ = .@menu$ + .@charname$[@ctr]+":";
    	.@menu = .@menu$ + "Cancel";
    
    	set .@selectedchar, select(.@menu)-1;
    	next;
    
    	if( .@selectedchar < .@count )
    	{
    		if( getcharid(0) != .@charid[.@selectedchar] )
    		{
    			query_sql("UPDATE `char` AS ch SET ch.last_map = ch.save_map, ch.last_x = ch.save_x, ch.last_y = ch.save_y WHERE ch.char_id = "+.@charid[.@selectedchar]);
    			mes .@charname$[@selectedchar] + "'s position has been reset.";
    		}
    		else
    		{
    			// TODO: instead of having if-else, its better not to show the invoker's name in selection.
    			mes "you cant reset your own position";
    		}
    	}
    	end;
    }

     

  8. havent tested it yet, but try it
     

    //===== rAthena Script =======================================
    //= Battleground: PVP
    //===== By: ==================================================
    //= AnnieRuru
    //===== Current Version: =====================================
    //= 1.1
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A simple battleground script:
    //= Kill players from the other team.
    //===== Additional Comments: =================================
    //= 1.0 First version, edited. [Euphy]
    //= 1.1 Added rewards for losers. [Athan17]
    //============================================================
    
    -	script	bg_pvp#control	-1,{
    OnInit:
    	.minplayer2start = 2;      // minimum players to start (ex. if 3vs3, set to 3)
    	.eventlasting    = 20*60;  // event duration before auto-reset (20 minutes * seconds)
    	setarray .rewarditem[0],   // rewards for the winning team: <item>,<amount>,...
    		501, 10;
    	setarray .rewardloser[0],	// rewards for the losing team: <item>,<amount>,...
    		969, 1;
    	end;
    OnStart:
    	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start )
    		end;
    
    	// create Battleground and teams
    	.red = waitingroom2bg( "guild_vs3", 13,50, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    	copyarray .team1aid, $@arenamembers, $@arenamembersnum;
    	.team1count = .minplayer2start;
    	.blue = waitingroom2bg( "guild_vs3", 86,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    	copyarray .team2aid, $@arenamembers, $@arenamembersnum;
    	.team2count = .minplayer2start;
    	delwaitingroom .rednpcname$;
    	delwaitingroom .bluenpcname$;
    	bg_warp .red, "guild_vs3", 13,50;
    	bg_warp .blue, "guild_vs3", 86,50;
    	.score[1] = .score[2] = .minplayer2start;
    	bg_updatescore "guild_vs3", .score[1], .score[2];
    
    	// match duration
    	sleep .eventlasting * 1000;
    
    	// end match, destroy Battleground, reset NPCs
    	if ( .score[1] > .score[2] ) {
    		mapannounce "guild_vs3", "- Red Team is victorious! -", bc_map;
    		callsub L_Reward, 1,2;
    	}
    	else if ( .score[1] < .score[2] ) {
    		mapannounce "guild_vs3", "- Blue Team is victorious! -", bc_map;
    		callsub L_Reward, 2,1;
    	}
    	else
    		mapannounce "guild_vs3", "- The match has ended in a draw! -", bc_map;
    	bg_warp .red, "prontera",152,178;
    	bg_warp .blue, "prontera",154,178;
    	bg_destroy .red;
    	bg_destroy .blue;
    	donpcevent .rednpcname$ +"::OnStart";
    	donpcevent .bluenpcname$ +"::OnStart";
    	end;
    
    L_Reward:
    	for ( .@i = 0; .@i < getd(".team"+ getarg(0) +"count"); .@i++ )
    		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
    	for ( .@i = 0; .@i < getd(".team"+ getarg(1) +"count"); .@i++ )
    		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(1) +"aid["+ .@i +"]" );
    	return;
    
    // "OnDeath" event
    OnRedDead:  callsub L_Dead, 1;
    OnBlueDead: callsub L_Dead, 2;
    L_Dead:
    	.score[ getarg(0) ]--;
    	bg_updatescore "guild_vs3", .score[1], .score[2];
    	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
    	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
    	bg_leave;
    	if ( !.score[ getarg(0) ] )
    		awake strnpcinfo(0);
    	sleep2 1250;
    	percentheal 100,100;
    	end;
    
    // "OnQuit" event
    OnRedQuit:  callsub L_Quit, 1;
    OnBlueQuit: callsub L_Quit, 2;
    L_Quit:
    	.score[ getarg(0) ]--;
    	bg_updatescore "guild_vs3", .score[1], .score[2];
    	percentheal 100, 100;
    	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
    	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
    	if ( !.score[ getarg(0) ] )
    		awake strnpcinfo(0);
    	end;
    }
    
    prontera,152,178,5	script	Red Team#bg_pvp	733,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .rednpcname$, "bg_pvp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
    	end;
    }
    
    prontera,154,178,5	script	Blue Team#bg_pvp	734,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .bluenpcname$, "bg_pvp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_pvp#control" ) +1, "bg_pvp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_pvp#control" );
    	end;
    }
    
    guild_vs3	mapflag	battleground	2
    guild_vs3	mapflag	nosave	SavePoint
    guild_vs3	mapflag	nowarp
    guild_vs3	mapflag	nowarpto
    guild_vs3	mapflag	noteleport
    guild_vs3	mapflag	nomemo
    guild_vs3	mapflag	nopenalty
    guild_vs3	mapflag	nobranch
    guild_vs3	mapflag	noicewall
    //guild_vs3	mapflag	hidemobhpbar

    the trick here is:

    callsub L_Reward, 1,2;
    and
    callsub L_Reward, 2,1;

    then

    L_Reward:
    	// using getarg(0)
    	for ( .@i = 0; .@i < getd(".team"+ getarg(0) +"count"); .@i++ )
    		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
        // using getarg(1)
    	for ( .@i = 0; .@i < getd(".team"+ getarg(1) +"count"); .@i++ )
    		getitem .rewarditem[0], .rewarditem[1], getd(".team"+ getarg(1) +"aid["+ .@i +"]" );
    	return;

    but i need confirmation also, coz didnt tried it yet. cheers!

  9. may i know who will use this NPC? anyone or GM only?
    is it like, a reset position in-game? so if you have another character that is stuck, you can just character select~>use another char then talk to this npc, list up all your characters then return to savepoint the selected char?
    or GM only npc that once accessed, the npc will list up all/online players then return a chosen player to their save point?

  10. 22 minutes ago, rakuzas said:

    Its working..

    I spend hours to make it right.. But I put it at wrong line.. And make it worse.. I tried make .loseside.. But i put getarg (2).. But it suppose as 0.. No wonder I got error.. And my other mistake put wrong script too.. Its a good lesson for me.. Thank you very much.. ^_^ I will remember this.. Need more to learn and still long way to go..

    Edit : BTW.. Why I got error unrecognized mapflag hidemobhpbar? rAthena updated this mapflag? Because my last update when release clan function..

    Cool! gonna try it also later.

    about hidemobhpbar, i guess its a new mapflag implemented around november? i also dont have it in my fork, its best not to use it if you don't need it, or pull from master.

  11. //===== rAthena Script =======================================
    //= Battleground: Emperium
    //===== By: ==================================================
    //= AnnieRuru
    //===== Current Version: =====================================
    //= 1.1
    //===== Compatible With: =====================================
    //= rAthena Project
    //===== Description: =========================================
    //= A simple battleground script:
    //= Destroy the opponent's Emperium to win the match.
    //===== Additional Comments: =================================
    //= 1.0 First version, edited. [Euphy]
    //= 1.1 Added rewards for losers. [Athan17]
    //============================================================
    
    -	script	bg_emp#control	-1,{
    OnInit:
    	.minplayer2start = 1;      // minimum players to start (ex. if 3vs3, set to 3)
    	.eventlasting    = 20*60;  // event duration before auto-reset (20 minutes * seconds)
    	setarray .rewarditem[0],   // rewards for the winning team: <item>,<amount>,...
    		501, 10;
    	setarray .rewardloser[0],	// rewards for the losing team: <item>,<amount>,...
    		969, 1;
    	.team1name$ = "Red";
    	.team2name$ = "Blue";
    	end;
    OnStart:
    	if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start )
    		end;
    
    	// create Battleground and teams
    	.red = waitingroom2bg( "bat_a01", 157,347, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    	copyarray .team1aid, $@arenamembers, $@arenamembersnum;
    	.team1count = .minplayer2start;
    	.blue = waitingroom2bg( "bat_a01", 142,51, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    	copyarray .team2aid, $@arenamembers, $@arenamembersnum;
    	.team2count = .minplayer2start;
    	delwaitingroom .rednpcname$;
    	delwaitingroom .bluenpcname$;
    	disablenpc .rednpcname$;
    	disablenpc .bluenpcname$;
    	setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";
    	setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";
    	bg_warp .red, "bat_a01", 171,346;
    	bg_warp .blue, "bat_a01", 162,50;
    	bg_updatescore "bat_a01", 0, 0;
    
    	// delay before match begins
    	sleep 6000;
    	mapannounce "bat_a01", "The rules are simple. The first team to break the opponent's Emperium wins!", bc_map;
    	sleep 3000;
    	for ( .@i = 5; .@i > 0; .@i-- ) {
    		mapannounce "bat_a01", "["+ .@i +"]", bc_map;
    		sleep 1000;
    	}
    	mapannounce "bat_a01", "Start!", bc_map;
    
    	// spawn Emperiums
    	bg_monster .red,"bat_a01",171,346, "--ja--",1915, strnpcinfo(3)+"::OnRedDown";
    	bg_monster .blue,"bat_a01",162,50, "--ja--",1914, strnpcinfo(3)+"::OnBlueDown";
    	delwall "bg_emp_town_red";
    	delwall "bg_emp_town_blue";
    
    	// match duration
    	sleep .eventlasting * 1000;
    
    	// end match, destroy Battleground, reset NPCs
    	killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";
    	killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";
    	if ( .winside ) {
    		mapannounce "bat_a01", "- "+ getd( ".team"+ .winside +"name$" ) +" Team is victorious! -", bc_map;
    		for ( .@i = 0; .@i < getd(".team"+ .winside +"count"); .@i++ )
    			getitem .rewarditem[0], .rewarditem[1], getd(".team"+ .winside +"aid["+ .@i +"]" );
    		for ( .@i = 0; .@i < getd(".team"+ .loseside +"count"); .@i++ )
    			getitem .rewardloser[0], .rewardloser[1], getd(".team"+ .loseside +"aid["+ .@i +"]" );
    		
    	} else
    		mapannounce "bat_a01", "- The match has ended in a draw! -", bc_map;
    	sleep 5000;
    	bg_warp .red, "prontera", 155,182;
    	bg_warp .blue, "prontera", 158,182;
    	bg_destroy .red;
    	bg_destroy .blue;
    	delwall "bg_emp_town_red";
    	delwall "bg_emp_town_blue";
    	deletearray .team1aid;
    	deletearray .team2aid;
    	.winside = .loseside = .team1count = .team2count = 0;
    	enablenpc .rednpcname$;
    	enablenpc .bluenpcname$;
    	donpcevent .rednpcname$ +"::OnStart";
    	donpcevent .bluenpcname$ +"::OnStart";
    	end;
    
    // Emperium destroyed
    OnRedDown:  callsub L_EmpDown, 1, 2;
    OnBlueDown: callsub L_EmpDown, 2, 1;
    L_EmpDown:
    	mapannounce "bat_a01", strcharinfo(0) +" has destroyed "+ getd( ".team"+ getarg(0) +"name$" ) +" Team's Emperium.", bc_map;
    	.winside = getarg(1);
    	.loseside = getarg(0);
    	awake strnpcinfo(0);
    	end;
    
    // "OnDeath" event
    OnRedDead:
    OnBlueDead:
    	sleep2 1250;
    	percentheal 100,100;
    	end;
    
    // "OnQuit" event
    OnRedQuit:  callsub L_Quit, 1, 2;
    OnBlueQuit: callsub L_Quit, 2, 1;
    L_Quit:
    	percentheal 100, 100;
    	while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++;
    	deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    	setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1;
    	if ( getd(".team"+ getarg(0) +"count") ) end;
    	mapannounce "bat_a01", "All "+ getd( ".team"+ getarg(0) +"name$" ) +" team members have quit!", bc_map, 0xff3333;
    	end;
    }
    
    prontera,155,182,5	script	Red Team#bg_emp	733,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );
    	end;
    }
    
    prontera,158,182,5	script	Blue Team#bg_emp	734,{
    	end;
    OnInit:
    	sleep 1;
    	set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0);
    OnStart:
    	waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, "bg_emp#control::OnStart", getvariableofnpc( .minplayer2start, "bg_emp#control" );
    	end;
    }
    
    bat_a01	mapflag	battleground
    bat_a01	mapflag	nosave	SavePoint
    bat_a01	mapflag	nowarp
    bat_a01	mapflag	nowarpto
    bat_a01	mapflag	noteleport
    bat_a01	mapflag	nomemo
    bat_a01	mapflag	nopenalty
    bat_a01	mapflag	nobranch
    bat_a01	mapflag	noicewall
    bat_a01	mapflag	hidemobhpbar

    can you try this? quick and dirty modification, gonna try this also when i get home. all thanks to AnnieRuru and Euphy for this awesome script

    • Upvote 1
  12. 25 minutes ago, Bringer said:

    Do you mind post the skill src so i can duplicate the skill?

    case KO_GENWAKU:
    		if ((dstsd || dstmd) && !status_has_mode(tstatus,MD_IGNOREMELEE|MD_IGNOREMAGIC|MD_IGNORERANGED|MD_IGNOREMISC) && battle_check_target(src,bl,BCT_ENEMY) > 0) {
    			int x = src->x, y = src->y;
    
    			if (sd && rnd()%100 > ((45+5*skill_lv) - status_get_int(bl)/10)) { //[(Base chance of success) - (Intelligence Objectives / 10)]%.
    				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    				break;
    			}
    
    			// Confusion is still inflicted (but rate isn't reduced), no matter map type.
    			status_change_start(src, src, SC_CONFUSION, 2500, skill_lv, 0, 0, 0, skill_get_time(skill_id, skill_lv), SCSTART_NORATEDEF);
    			status_change_start(src, bl, SC_CONFUSION, 7500, skill_lv, 0, 0, 0, skill_get_time(skill_id, skill_lv), SCSTART_NORATEDEF);
    
    			if (skill_check_unit_movepos(5,src,bl->x,bl->y,0,0)) {
    				clif_skill_nodamage(src, src, skill_id, skill_lv, 1);
    				clif_blown(src);
    				if (!unit_blown_immune(bl, 0x1)) {
    					unit_movepos(bl,x,y,0,0);
    					if (bl->type == BL_PC && pc_issit((TBL_PC*)bl))
    						clif_sitting(bl); //Avoid sitting sync problem
    					clif_blown(bl);
    				}
    			}
    		}
    		break;

    here, they're from rAthena skill.c, not my own, so no need to rep up me :D

  13. 11 hours ago, KingRamses said:

    Where you said "add this line on success" you mean on casshop.h?

        "CASHSHOP_RESULT_SUCCESS =  0x0,     set CashUsed, 1;"

       " CASHSHOP_RESULT_SUCCESS =  0x0,

        set CashUsed, 1;"

    Which one would be the correct way?

    base on your last question, i guess you're using the cash shop on screen button. I'm not sure how it really works, but i guess you need some source editing and set CashUsed on payment.

    the script i gave you were char-bound, and it will only work on script type shops with OnBuyItem event handler. "callshop" ~> "npcshopattach"

    ...
    upon reading builtin cashop.c, it looks like you need to edit pc.c under pc_paycash, and you need to modify the script i gave you from char-bound to account-bound since #CASHPOINTS is account-bound.
    im not sure what to add, but i think this is becoming a source modify request rather than script request.

  14. 1 minute ago, DutchDuck said:

    So in order to  add testmap into mapnametable  i need to put testmap into the existing file 

    edit the file you want to modify, then add them in your patch.

    example:
    A file has: prontera,geffen,payon

    now you edit A file, lets call it B file
    B file has: prontera,geffen,payon,testmap

    when you add B file to patch, patch to A
    A file will become: prontera,geffen,payon,testmap

    now if you make new file call C file and made like this:
    C file: testmap

    when you add C file to patch, patch to A
    A file will become: testmap

    what happened to prontera,geffen,payon? they were gone because you made a new file.

  15. depends on how Donation cash points works on your server.

    There are servers who uses items like Donation stub or Cash stubs that is used to buy cash items,
    while others use account-bound points like #CASHPOINTS,
    some use character-bound points.
    (i am not aware of how official cash points works, i only knew the old times like paytoplay, $1 = 8hours gameplay)

     

    prontera,160,160,4	script	Donator Ranking	909,{
    	mes "Top 10 Donators";
    	set .@count, query_sql("SELECT `crn`.`value`,`c`.`name` FROM `char_reg_num` `crn` INNER JOIN `char` `c` ON `crn`.`char_id` = `c`.`char_id` WHERE `crn`.`key` = \"CashUsed\" ORDER BY `crn`.`value` DESC LIMIT 10",.@ptval,.@ptchar$);
    
    	set .@check,0;
    
    	for ( set .@ctr,0; .@ctr < .@count; .@ctr++ ) {
    		mes (.@ctr+1)+". ^ff0000"+.@ptchar$[.@ctr]+"^000000 ~> ^ff0000"+.@ptval[.@ctr]+"pts^000000";
    		if( .@ptchar$[.@ctr] == strcharinfo(0) )
    			.@check = .@ctr+1;
    	}
    
    	if( !DonatorRewarded && .@check && gettime( .DayofRewarding )  )
    	{
    		next;
    		mes "Wow! our ^ff0000" + .RankText[.@check] + "^000000 place in rank"; // .@check is the rank number of the player.
    		mes "Thank you for donating, here's your reward.";
    		getitem .DonateReward,.DRamount;
    		set DonatorRewarded,1;
    	}
    	end;
    
    OnInit:
    	set .DonateReward, 969; //Reward itemid
    	set .DRamount, 10; //Reward amount;
        //TODO: Different rewards with each ranker.
    
    	set .DayofRewarding, 6; // Only give reward every saturday
    	set .DayofReset, 0; // reset every Sunday 12am
    
    	setarray .RankText$[1],"1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th";
    end;
    
    OnClock0001:
    	if( gettime( .DayofReset ) )
    	{
    		// reset list of players rewarded already.
    		query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'DonatorRewarded'");
    
    		// reset donation ranking
    		query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'CashUsed'");
    
    		addrid(0); // Attach all (online)players in the server
            // Delete  for Online players
    		set DonatorRewarded, 0;
            set CashUsed, 0;
    	}
    end;
    }
    
    Then in your Cash shop, if you have OnBuyItem, add these line on success in buying an item.
    set CashUsed, 1; //set how many he/she spent.

    haven't tested this script yet.
    you might wanna add these feature in this script:
    * different reward items and amount per rank

    EDIT:
    yeah i forgot, this script is for Top 10 Cash spender, and give rewards to 10 most spending players every week.

    EDIT:
    Applied patches according to senpai Emistry's suggestion, thank you! learned something today (y)

  16. from what i research so far, thara frog card DO affect magic damage. but if you really want ALL magical damages to ignore race calculation, here's a solution:
    src/battle.c
     

    int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_list *target, int nk, int rh_ele, int lh_ele, int64 damage, int left, int flag){
    .....
    #define APPLY_CARDFIX(damage, fix) { (damage) = (damage) - (int64)(((damage) * (1000 - (fix))) / 1000); }
    
    	switch( attack_type ) {
    		case BF_MAGIC:
    ........
    				cardfix = cardfix * (100 - tsd->subsize[sstatus->size] - tsd->subsize[SZ_ALL]) / 100;
    				cardfix = cardfix * (100 - tsd->subrace2[s_race2]) / 100;
    				cardfix = cardfix * (100 - tsd->subrace[sstatus->race] - tsd->subrace[RC_ALL]) / 100;
    				cardfix = cardfix * (100 - tsd->subclass[sstatus->class_] - tsd->subclass[CLASS_ALL]) / 100;
    
    
    comment out the tsd->subrace
    
    				cardfix = cardfix * (100 - tsd->subsize[sstatus->size] - tsd->subsize[SZ_ALL]) / 100;
    				cardfix = cardfix * (100 - tsd->subrace2[s_race2]) / 100;
    				//cardfix = cardfix * (100 - tsd->subrace[sstatus->race] - tsd->subrace[RC_ALL]) / 100;
    				cardfix = cardfix * (100 - tsd->subclass[sstatus->class_] - tsd->subclass[CLASS_ALL]) / 100;

    not yet tested

  17. https://github.com/rathena/rathena/blob/master/doc/item_bonus.txt

     

    Strip/Break equipment
    ---------------------
    bonus bUnstripableWeapon,n;		Weapon cannot be taken off via Strip skills (n is meaningless)
    bonus bUnstripableArmor,n; 		Armor cannot be taken off via Strip skills (n is meaningless)
    bonus bUnstripableHelm,n;  		Helm cannot be taken off via Strip skills (n is meaningless)
    bonus bUnstripableShield,n;		Shield cannot be taken off via Strip skills (n is meaningless)
    bonus bUnstripable,n;      		All equipment cannot be taken off via strip skills (n is meaningless)
    
    bonus bUnbreakableGarment,n;		Garment cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakableWeapon,n; 		Weapon cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakableArmor,n;  		Armor cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakableHelm,n;   		Helm cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakableShield,n; 		Shield cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakableShoes,n;  		Shoes cannot be damaged/broken by any means (n is meaningless)
    bonus bUnbreakable,n;       		Reduces the break chance of all equipped equipment by n%
    
    bonus bBreakWeaponRate,n;		Adds a n/100% chance to break enemy's weapon while attacking (stacks with other break chances)
    bonus bBreakArmorRate,n; 		Adds a n/100% chance to break enemy's armor while attacking (stacks with other break chances)

     

  18. question:
    1. did you add your items in itemdb.txt? (server side)
    2. is your custom item ids all in 30000? if so, change them, it should be unique. (30000,30001,30002...)
    3. have you tried using the most powerful search engine called Google? or atleast the search button found inside this forums?

    press TAB button for indenting lines
     

×
×
  • Create New...