Skip to content

Commit

Permalink
Refactored hardcoded npc event names (rathena#1767)
Browse files Browse the repository at this point in the history
While refactoring those events the following other changes were made:

Introducing OnInstanceDestroy event. This event can be used to hook script code right in front of the instance destruction. This can be useful if you have any stored references to an instance id for example.

The script command cmdothernpc will now check if the target event exists and report failures. Therefore it now returns true or false.

All agit(FE,SE,TE) start and end commands from atcommand and script commands have been merged in their respective guild function which now returns a bool value of true for successful actions and false if it did not succeed(if the specific WoE was [not] running).

All global triggered events with mapserver status output now call the same function and therefore have the same mapserver output(including their respective event name of course).

Renamed a few events in the script configuration to match the other names

Added constants for months and weekdays

Additionally added constants for gettime types to make it easier to read.

Replaced all existing usages I found with their proper new syntax or better fitting functions.
  • Loading branch information
Lemongrass3110 authored Jan 10, 2017
1 parent 870273e commit 2043c95
Show file tree
Hide file tree
Showing 47 changed files with 666 additions and 416 deletions.
4 changes: 2 additions & 2 deletions db/pre-re/item_db.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@
5429,Bogy_Cap,Bogy Cap,4,20,,100,,2,,1,0xFFFFFFFF,7,2,256,,0,1,430,{ bonus bHPrecovRate, 5; bonus bSPrecovRate, 5; },{},{}
5430,Sacred_Torch_Coronet,Torch Cap,4,20,,0,,3,,0,0xFFFFFFFF,7,2,256,,0,0,431,{ bonus2 bSubEle,Ele_Fire,20; skill "MG_FIREBOLT",5; },{},{}
5431,Chicken_Hat,Chicken Hat,4,20,,1000,,0,,1,0xFFFFFFFF,7,2,256,,30,1,432,{ bonus3 bAutoSpell,"MC_LOUD",1,30; bonus bAspdRate,5; },{},{}
5432,Brazil_Baseball_Cap,bRO 4th Anniversary Hat,4,20,,100,,0,,0,0xFFFFFFFF,7,2,256,,0,1,433,{ if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats, 4; },{},{}
5432,Brazil_Baseball_Cap,bRO 4th Anniversary Hat,4,20,,100,,0,,0,0xFFFFFFFF,7,2,256,,0,1,433,{ if(gettime(DT_MONTH)==SEPTEMBER&&gettime(DT_DAYOFMONTH)>=10&&gettime(DT_DAYOFMONTH)<=24) bonus bAllStats, 4; },{},{}
5433,Golden_Wreath,Golden Laurel,4,20,,100,,0,,0,0xFFFFFFFF,7,2,256,,0,1,434,{},{},{}
//5434,Cola_Can,Cola Can,4,20,,100,,2,,1,0xFFFFFFFF,7,2,256,,0,1,435,{},{},{}
5435,Coke_Hat,Red Minstrel Hat,4,20,,100,,1,,1,0xFFFFFFFF,7,2,256,,40,1,436,{ bonus bInt,1; bonus bMaxSP,80; bonus bMdef,3; if(getrefine()>5) { bonus bMdef,getrefine()-5; bonus bMaxSP,(getrefine()-5)*10; } },{},{}
Expand Down Expand Up @@ -4696,7 +4696,7 @@
12130,Cookie_Bag,Cookie Bag,2,2,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ getrandgroupitem(IG_CookieBag),1; getrandgroupitem(IG_CookieBag),1; getrandgroupitem(IG_CookieBag),1; },{},{}
12131,Lucky_Potion,Lucky Potion,0,2,,100,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
12132,Red_Bag,Santa's Bag,2,0,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_Xmas,600000,0; },{},{}
12133,Ice_Cream_,McDonald's Ice Cone,0,0,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ if(gettime(5)!=MDiceCone) { set MDiceCone,gettime(5); percentheal 50,50; } },{},{}
12133,Ice_Cream_,McDonald's Ice Cone,0,0,,80,,,,,0xFFFFFFFF,7,2,,,,,,{ if(gettime(DT_DAYOFMONTH)!=MDiceCone) { set MDiceCone,gettime(DT_DAYOFMONTH); percentheal 50,50; } },{},{}
12134,Red_Envelope,Red Envelope,2,1,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ set Zeny,Zeny+rand(1000,10000); },{},{}
12135,Green_Ale,Green Ale,2,20,,30,,,,,0xFFFFFFFF,7,2,,,,,,{ percentheal 50,50; sc_start SC_Confusion,10000,0,1000,0; },{},{}
12136,Women's_Bundle,Women's Bundle,2,0,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem callfunc("F_Rand",558,529,2668,7518),1; },{},{}
Expand Down
4 changes: 2 additions & 2 deletions db/re/item_db.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3549,7 +3549,7 @@
5429,Bogy_Cap,Bogy Cap,4,20,,100,,4,,1,0xFFFFFFFF,63,2,256,,0,1,430,{ bonus bHPrecovRate,5; bonus bSPrecovRate,5; },{},{}
5430,Sacred_Torch_Coronet,Torch Cap,4,20,,0,,6,,0,0xFFFFFFFF,63,2,256,,0,0,431,{ bonus2 bSubEle,Ele_Fire,20; skill "MG_FIREBOLT",5; },{},{}
5431,Chicken_Hat,Chicken Hat,4,20,,1000,,0,,1,0xFFFFFFFF,63,2,256,,30,1,432,{ bonus3 bAutoSpell,"MC_LOUD",1,30; bonus bAspdRate,5; },{},{}
5432,Brazil_Baseball_Cap,bRO 4th Anniversary Hat,4,20,,100,,0,,0,0xFFFFFFFF,63,2,256,,0,1,433,{ if(gettime(6)==9&&gettime(5)>=10&&gettime(5)<=24) bonus bAllStats,4; },{},{}
5432,Brazil_Baseball_Cap,bRO 4th Anniversary Hat,4,20,,100,,0,,0,0xFFFFFFFF,63,2,256,,0,1,433,{ if(gettime(DT_MONTH)==SEPTEMBER&&gettime(DT_DAYOFMONTH)>=10&&gettime(DT_DAYOFMONTH)<=24) bonus bAllStats,4; },{},{}
5433,Golden_Wreath,Golden Laurel,4,20,,100,,0,,0,0xFFFFFFFF,63,2,256,,0,1,434,{},{},{}
5434,Cola_Can,Cola Can,4,20,,100,,3,,1,0xFFFFFFFF,63,2,256,,0,1,435,{},{},{}
5435,Coke_Hat,Red Minstrel Hat,4,20,,100,,2,,1,0xFFFFFFFF,63,2,256,,40,1,436,{ bonus bInt,1; bonus bMaxSP,80; bonus bMdef,3; .@r = getrefine(); if(.@r>5) { bonus bMdef,.@r-5; bonus bMaxSP,(.@r-5)*10; } },{},{}
Expand Down Expand Up @@ -6263,7 +6263,7 @@
12130,Cookie_Bag,Cookie Bag,2,2,,70,,,,,0xFFFFFFFF,63,2,,,,,,{ getrandgroupitem(IG_CookieBag,1); getrandgroupitem(IG_CookieBag,1); getrandgroupitem(IG_CookieBag,1); },{},{}
12131,Lucky_Potion,Lucky Potion,0,2,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ /* sc_start SC_LUKFOOD,180000,15; */ },{},{}
12132,Red_Bag,Santa's Bag,2,0,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_XMAS,600000,0; sc_start SC_SPEEDUP0,600000,25; },{},{}
12133,Ice_Cream_,McDonald's Ice Cone,0,0,,80,,,,,0xFFFFFFFF,63,2,,,,,,{ if(gettime(5)!=MDiceCone) { MDiceCone = gettime(5); percentheal 50,50; } },{},{}
12133,Ice_Cream_,McDonald's Ice Cone,0,0,,80,,,,,0xFFFFFFFF,63,2,,,,,,{ if(gettime(DT_DAYOFMONTH)!=MDiceCone) { MDiceCone = gettime(DT_DAYOFMONTH); percentheal 50,50; } },{},{}
12134,Red_Envelope,Red Envelope,2,1,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ Zeny += rand(1000,10000); },{},{}
12135,Green_Ale,Green Ale,2,20,,30,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 50,50; sc_start SC_CONFUSION,10000,0,1000,0; },{},{}
12136,Women's_Bundle,Women's Bundle,2,0,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem callfunc("F_Rand",558,529,2668,7518),1; },{},{}
Expand Down
19 changes: 10 additions & 9 deletions doc/sample/npc_test_time.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20070315
//= 20161206
//===== Description: =========================================
//= Demonstrates time commands.
//============================================================
Expand All @@ -12,14 +12,15 @@ prontera,157,181,6 script Time Sample 105,{
mes "[Time Sample]";
mes "System Tick : " + gettimetick(0);
mes " Time Tick : " + gettimetick(1);
mes " GetTime(0) : " + gettime(0);
mes " GetTime(1) : " + gettime(1) + " (Sec)";
mes " GetTime(2) : " + gettime(2) + " (Min)";
mes " GetTime(3) : " + gettime(3) + " (Hour)";
mes " GetTime(4) : " + gettime(4) + " (WeekDay)";
mes " GetTime(5) : " + gettime(5) + " (MonthDay)";
mes " GetTime(6) : " + gettime(6) + " (Month)";
mes " GetTime(7) : " + gettime(7) + " (Year)";
mes " Unix Tick : " + gettimetick(2);
mes " GetTime(DT_SECOND) : " + gettime(DT_SECOND) + " (Sec)";
mes " GetTime(DT_MINUTE) : " + gettime(DT_MINUTE) + " (Min)";
mes " GetTime(DT_HOUR) : " + gettime(DT_HOUR) + " (Hour)";
mes " GetTime(DT_DAYOFWEEK) : " + gettime(DT_DAYOFWEEK) + " (Day of week)";
mes " GetTime(DT_DAYOFMONTH) : " + gettime(DT_DAYOFMONTH) + " (Day of month)";
mes " GetTime(DT_MONTH) : " + gettime(DT_MONTH) + " (Month)";
mes " GetTime(DT_YEAR) : " + gettime(DT_YEAR) + " (Year)";
mes " GetTime(DT_DAYOFYEAR) : " + gettime(DT_DAYOFYEAR) + " (Day of year)";
mes " GetTimeStr : " + gettimestr("%Y-%m/%d %H:%M:%S",19);
close;
}
36 changes: 23 additions & 13 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20160523
//= 20161206
//===== Description: =========================================
//= A reference manual for the rAthena scripting language.
//= Commands are sorted depending on their functionality.
Expand Down Expand Up @@ -900,6 +900,13 @@ This label will be executed when an instance is created and initialized through
the 'instance_create' command. It will run again if @reloadscript is used while
an instance is in progress.

OnInstanceDestroy:

This label will be executed when an instance is destroyed by a timeout, exceeding
the keepalive time or through the 'instance_destroy' command. It will be called
exactly before the instance will be destroyed and all other NPCs of the instance
will still be available at this point of time.

OnTouch:

This label will be executed if a trigger area is defined for the NPC object it's
Expand Down Expand Up @@ -2998,18 +3005,18 @@ This function will return a tick depending on <tick type>:

This function will return specified information about the current system time.

1 - Seconds (of a minute)
2 - Minutes (of an hour)
3 - Hour (of a day)
4 - Week day (0 for Sunday, 6 is Saturday)
5 - Day of the month.
6 - Number of the month.
7 - Year.
8 - Day of the year.
DT_SECOND - Seconds (of the current minute)
DT_MINUTE - Minutes (of the current hour)
DT_HOUR - Hour (of the current day)
DT_DAYOFWEEK - Week day (constants for MONDAY to SUNDAY are available)
DT_DAYOFMONTH - Day of the current month
DT_MONTH - Month (constants for JANUARY to DECEMBER are available)
DT_YEAR - Year
DT_DAYOFYEAR - Day of the year

It will only return numbers.
It will only return numbers. If another type is supplied -1 will be returned.

if (gettime(4)==6) mes "It's a Saturday. I don't work on Saturdays.";
if (gettime(DT_DAYOFWEEK)==SATURDAY) mes "It's a Saturday. I don't work on Saturdays.";

---------------------------------------

Expand Down Expand Up @@ -6066,6 +6073,8 @@ A debug message also shows on the console when no events are triggered.
This is simply "donpcevent <npc name>::OnCommand<command>".
It is an approximation of official server script language's 'cmdothernpc'.

Returns true if the command was executed on the other NPC successfully, false if not.

---------------------------------------

*npctalk "<message>"{,"<NPC name>"};
Expand Down Expand Up @@ -7681,7 +7690,7 @@ OnClock0600:
end;
OnInit:
// setting correct mode upon server start-up
if(gettime(3)>=6 && gettime(3)<18) end;
if(gettime(DT_HOUR)>=6 && gettime(DT_HOUR)<18) end;
OnClock1800:
night;
end;
Expand Down Expand Up @@ -8276,7 +8285,8 @@ Destroys instance with the ID <instance id>. If no ID is specified, the instance
the script is attached to is used. If the script is not attached to an instance,
the instance of the currently attached player is used (if it is a character, party,
or guild mode). If it is not owned by anyone, no player needs to be attached. If
that fails, the script will come to a halt.
that fails, the script will come to a halt. This will also trigger the "OnInstanceDestroy"
label in all NPCs inside the instance.

---------------------------------------

Expand Down
52 changes: 26 additions & 26 deletions doc/woe_time_explanation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//===== By: ==================================================
//= erKURITA
//===== Last Updated: ========================================
//= 20120717
//= 20161206
//===== Description: =========================================
//= Details on the behavior of the default WoE controller.
//============================================================
Expand All @@ -18,43 +18,43 @@ OnClock2350: would run at 23:50, server time.
gettime(<type>) is a function that checks for certain
information regarding time. The types are:

1 - Seconds (of a minute)
2 - Minutes (of an hour)
3 - Hour (of a day), ranging from 0 to 23
4 - Weekday, ranging from 0 (Sunday) to 6 (Saturday)
5 - Day of the month
6 - Number of the month
7 - Year
8 - Day of the year
DT_SECOND - Seconds (of the current minute)
DT_MINUTE - Minutes (of the current hour)
DT_HOUR - Hour (of the current day)
DT_DAYOFWEEK - Week day (constants for MONDAY to SUNDAY are available)
DT_DAYOFMONTH - Day of the current month
DT_MONTH - Month (constants for JANUARY to DECEMBER are available)
DT_YEAR - Year
DT_DAYOFYEAR - Day of the year

This way, we can check for a desired minute, hour, day, month, etc.

-------------------------------------------------------------------------------

Now the structure:

OnClock2100: // Start time for Tues(2), Thurs(4)
OnClock2300: // End time for Tues(2), Thurs(4)
OnClock1600: // Start time for Sat(6)
OnClock1800: // End time for Sat(6)
OnClock2100: // Start time for Tuesday and Thursday
OnClock2300: // End time for Tuesday and Thursday
OnClock1600: // Start time for Saturday
OnClock1800: // End time for Saturday

These 4 labels will run one after the other, reaching the next check:

if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23)) goto L_Start;
if((gettime(4)==4) && (gettime(3)>=21 && gettime(3)<23)) goto L_Start;
if((gettime(4)==6) && (gettime(3)>=16 && gettime(3)<18)) goto L_Start;
if((gettime(DT_DAYOFWEEK)==TUESDAY) && (gettime(DT_HOUR)>=21 && gettime(DT_HOUR)<23)) goto L_Start;
if((gettime(DT_DAYOFWEEK)==THURSDAY) && (gettime(DT_HOUR)>=21 && gettime(DT_HOUR)<23)) goto L_Start;
if((gettime(DT_DAYOFWEEK)==SATURDAY) && (gettime(DT_HOUR)>=16 && gettime(DT_HOUR)<18)) goto L_Start;

This part will check for the times. Since both Start and End times run
through the same chain of commands, these are important checks to ensure
it's the right time. Let's take the following example:

if((gettime(4)==2) && (gettime(3)>=21 && gettime(3)<23))
if((gettime(DT_DAYOFWEEK)==TUESDAY) && (gettime(DT_HOUR)>=21 && gettime(DT_HOUR)<23))

The first gettime() is checking for a type 4, the day of the week, and it's
comparing it to the one desired, which is 2 (Tuesday). The function will
return either 1 (true) or 0 (false).
The first gettime() is checking for a type DT_DAYOFWEEK, the day of the week, and it's
comparing it to the one desired, which is TUESDAY. The function will
return either true or false.

The second gettime is checking type 3, the hour, and it's comparing
The second gettime is checking type DT_HOUR, the hour, and it's comparing
it to 21. If the first part is greater than or equal to (>=) the second part,
the comparison will return 1.

Expand All @@ -75,9 +75,9 @@ It's saying that if X and G are true, the condition is met, thus proceeding to L

Now, the last part of the script, regarding the end of WoE time:

if((gettime(4)==2) && (gettime(3)==23)) goto L_End;
if((gettime(4)==4) && (gettime(3)==23)) goto L_End;
if((gettime(4)==6) && (gettime(3)==18)) goto L_End;
if((gettime(DT_DAYOFWEEK)==TUESDAY) && (gettime(DT_HOUR)==23)) goto L_End;
if((gettime(DT_DAYOFWEEK)==THURSDAY) && (gettime(DT_HOUR)==23)) goto L_End;
if((gettime(DT_DAYOFWEEK)==SATURDAY) && (gettime(DT_HOUR)==18)) goto L_End;
end;

This is the same as before, but it's checking for the day in the first gettime() and
Expand All @@ -97,6 +97,6 @@ An example of how to set the WoE so it starts on Monday, at 4 pm and ends up at

OnAgitInit: // This can only be written once: put OnClock above and the checks below.

if ((gettime(4)==1) && (gettime(3)>=16 && gettime(3)<22)) goto L_Start;
if ((gettime(4)==1) && (gettime(3)==22) goto L_End;
if ((gettime(DT_DAYOFWEEK)==MONDAY) && (gettime(DT_HOUR)>=16 && gettime(DT_HOUR)<22)) goto L_Start;
if ((gettime(DT_DAYOFWEEK)==MONDAY) && (gettime(DT_HOUR)==22) goto L_End;
end; // Don't forget this!
8 changes: 4 additions & 4 deletions npc/airports/airships.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1139,18 +1139,18 @@ airplane_01,32,61,4 script Nils#ein 49,1,1,{
mes .@line1_1$[.@wordtest];
mes .@line1_2$[.@wordtest];
mes .@line1_3$[.@wordtest];
set .@start_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
set .@start_time, gettimetick(1);
next;
input .@save1$;
set .@end_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
set .@end_time, gettimetick(1);
set .@total_time, .@end_time - .@start_time;
mes "[Nils]";
mes .@line2_1$[.@wordtest];
mes .@line2_2$[.@wordtest];
set .@start_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
set .@start_time, gettimetick(1);
next;
input .@save2$;
set .@end_time, gettime(3)*60*60 + gettime(2)*60 + gettime(1);
set .@end_time, gettimetick(1);
set .@total_time, .@total_time + (.@start_time - .@end_time);
set .@tasoo, (.@letters[.@wordtest] / .@total_time) * 6;
if ((.@save1$ == .@word1$[.@wordtest]) && (.@save2$ == .@word2$[.@wordtest])) {
Expand Down
4 changes: 2 additions & 2 deletions npc/custom/etc/airplane.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function script F_Itin {

seta:
set @tempo, @tempo + 1;
set @time, gettime(3);
set @time, gettime(DT_HOUR);
set @minutes, 5 * @tempo - 5;
set @minutess, 5 * @tempo - 2;
if(@minutes<10)set @minutes$, "0" + @minutes;
Expand All @@ -408,7 +408,7 @@ seta:
setb:
if($@currenttime - 1==@tempo)goto setc;
set @tempo, @tempo + 1;
set @time, gettime(3) + 1;
set @time, gettime(DT_HOUR) + 1;
set @minutes, 5 * @tempo - 5;
set @minutess, 5 * @tempo - 2;
if(@minutes<10)set @minutes$, "0" + @minutes;
Expand Down
2 changes: 1 addition & 1 deletion npc/custom/etc/bank_kafra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
mes"[Maniss]";
mes strcharinfo(0)+", welcome to the 2nd Bank of Prontera!";

set @kb_int,(gettime(6)*31)+gettime(5); //today's number
set @kb_int,(gettime(DT_MONTH)*31)+gettime(DT_DAYOFMONTH); //today's number
set @income,0;
//calculate %
if (#kafrabank<=0 || #kb_int>=@kb_int) goto L_NoIncomeToday;
Expand Down
10 changes: 5 additions & 5 deletions npc/custom/events/holiday/valentinesdayexp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ prontera,156,172,4 script Tine 58,{
// mes "@dsv: "+@dsv;
// mes "ispartneron()=="+ispartneron();
// mes "Sex == "+Sex;
// if(@dsv == gettime(3)+1) mes "@dsv == gettime(3)+1";
// if(@dsv == gettime(DT_HOUR)+1) mes "@dsv == gettime(DT_HOUR)+1";

mes "[Tine]";
mes "The legend says that on 14th February... on the Day of Saint Valentine...";
Expand Down Expand Up @@ -62,14 +62,14 @@ M_INFO:

OnInit:
//559,Hand-made_Chocolate
setitemscript 559,"{ itemheal 50,50; if(Sex==SEX_FEMALE || @dsv == gettime(3)+1 || ispartneron()==0)end; set @dsv,gettime(3)+1; misceffect 113; }";
setitemscript 559,"{ itemheal 50,50; if(Sex==SEX_FEMALE || @dsv == gettime(DT_HOUR)+1 || ispartneron()==0)end; set @dsv,gettime(DT_HOUR)+1; misceffect 113; }";
//560,Hand-made_White_Chocolate
setitemscript 560,"{ itemheal 50,50; if(Sex==SEX_MALE || @dsv == gettime(3)+1 || ispartneron()==0)end; set @dsv,gettime(3)+1; misceffect 113; }";
setitemscript 560,"{ itemheal 50,50; if(Sex==SEX_MALE || @dsv == gettime(DT_HOUR)+1 || ispartneron()==0)end; set @dsv,gettime(DT_HOUR)+1; misceffect 113; }";

//2634,Wedding_Ring_M,Wedding Ring,5,,10,0,,0,,0,127918079,7,1,136,,0,0,0,{ skill 334,1; skill 335,1; skill 336,1; }
setitemscript 2634,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(3)+1 && ispartneron()){ bonus2 bExpAddRace,5,50; bonus2 bExpAddRace,6,50; bonus2 bExpAddRace,7,50; bonus2 bExpAddRace,8,50; bonus2 bExpAddRace,1,50; } }";
setitemscript 2634,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(DT_HOUR)+1 && ispartneron()){ bonus2 bExpAddRace,5,50; bonus2 bExpAddRace,6,50; bonus2 bExpAddRace,7,50; bonus2 bExpAddRace,8,50; bonus2 bExpAddRace,1,50; } }";
//2635,Wedding_Ring_F,Wedding Ring,5,,10,0,,0,,0,127918079,7,0,136,,0,0,0,{ skill 334,1; skill 335,1; skill 336,1; }
setitemscript 2635,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(3)+1 && ispartneron()){ bonus2 bExpAddRace,0,50; bonus2 bExpAddRace,9,50; bonus2 bExpAddRace,2,50; bonus2 bExpAddRace,3,50; bonus2 bExpAddRace,4,50; } }";
setitemscript 2635,"{ skill 334,1; skill 335,1; skill 336,1; if(@dsv == gettime(DT_HOUR)+1 && ispartneron()){ bonus2 bExpAddRace,0,50; bonus2 bExpAddRace,9,50; bonus2 bExpAddRace,2,50; bonus2 bExpAddRace,3,50; bonus2 bExpAddRace,4,50; } }";
end;
}

Expand Down
2 changes: 1 addition & 1 deletion npc/custom/events/holiday/xmas_rings_event.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ M_QUEST:

OnInit:
//Santa's Hat
setitemscript 2236,"{ bonus bMdef,1; bonus bLuk,1; if(isequipped(2636,2637)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 410; end;} if(isequipped(2636)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 72;} if(isequipped(2637)){if(@xmr == gettime(2))end; set @xmr,gettime(2); misceffect 338;}}";
setitemscript 2236,"{ bonus bMdef,1; bonus bLuk,1; if(isequipped(2636,2637)){if(@xmr == gettime(DT_MINUTE))end; set @xmr,gettime(DT_MINUTE); misceffect 410; end;} if(isequipped(2636)){if(@xmr == gettime(DT_MINUTE))end; set @xmr,gettime(DT_MINUTE); misceffect 72;} if(isequipped(2637)){if(@xmr == gettime(DT_MINUTE))end; set @xmr,gettime(DT_MINUTE); misceffect 338;}}";
//Gold Xmas Ring
setitemscript 2636,"{ bonus bLoseSPWhenUnequip,30; if(isequipped(2236)==0)end; if(getskilllv(\"AL_HEAL\")){skill \"TF_HIDING\",4+isequipped(2637);}else{skill \"AL_HEAL\",1+4*isequipped(2637);} }";
//Silver Xmas Ring
Expand Down
Loading

0 comments on commit 2043c95

Please sign in to comment.