diff options
Diffstat (limited to 'npc/other')
-rw-r--r-- | npc/other/CashShop_Functions.txt | 39 | ||||
-rw-r--r-- | npc/other/Global_Functions.txt | 203 | ||||
-rw-r--r-- | npc/other/acolyte_warp.txt | 12 | ||||
-rw-r--r-- | npc/other/arena/arena_aco.txt | 8 | ||||
-rw-r--r-- | npc/other/arena/arena_lvl50.txt | 6 | ||||
-rw-r--r-- | npc/other/arena/arena_lvl60.txt | 6 | ||||
-rw-r--r-- | npc/other/arena/arena_lvl70.txt | 6 | ||||
-rw-r--r-- | npc/other/arena/arena_lvl80.txt | 6 | ||||
-rw-r--r-- | npc/other/arena/arena_party.txt | 6 | ||||
-rw-r--r-- | npc/other/comodo_gambling.txt | 11 | ||||
-rw-r--r-- | npc/other/divorce.txt | 2 | ||||
-rw-r--r-- | npc/other/gympass.txt | 16 | ||||
-rw-r--r-- | npc/other/hugel_bingo.txt | 37 | ||||
-rw-r--r-- | npc/other/inventory_expansion.txt | 63 | ||||
-rw-r--r-- | npc/other/marriage.txt | 34 | ||||
-rw-r--r-- | npc/other/monster_race.txt | 2 | ||||
-rw-r--r-- | npc/other/poring_war.txt | 4 | ||||
-rw-r--r-- | npc/other/private_airship.txt | 66 |
18 files changed, 403 insertions, 124 deletions
diff --git a/npc/other/CashShop_Functions.txt b/npc/other/CashShop_Functions.txt index 629e91b8a..5b957f9f2 100644 --- a/npc/other/CashShop_Functions.txt +++ b/npc/other/CashShop_Functions.txt @@ -56,10 +56,14 @@ function script F_CashStore { // - Summons Party members on party leader map to that location. // - No arguments. function script F_CashPartyCall { - warp "Random",0,0; - if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { - getmapxy(.@mapl$, .@xl, .@yl, UNITTYPE_PC); - warpparty .@mapl$, .@xl, .@yl, getcharid(CHAR_ID_PARTY), .@mapl$; + warp "Random", 0, 0; + if (getpartyleader(getcharid(CHAR_ID_PARTY), 2) == getcharid(CHAR_ID_CHAR)) { + getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); + do { + .@x2 = .@x + rand(-2, 2); + .@y2 = .@y + rand(-2, 2); + } while (checkcell(.@map$, .@x2, .@y2, cell_chknopass)); + warpparty(.@map$, .@x2, .@y2, getcharid(CHAR_ID_PARTY), .@map$, false); } return; } @@ -306,3 +310,30 @@ function script F_Snowball { } end; } + +// Status reduction potion +//============================================================ +// - Permanently reduces base stat <type> by <val>. +// - Returns status points equals to points needed to raise +// that stat to original value. +// - Doesn't work if base status <type> would become lower than 1 after reduction. +// * callfunc("F_CashReduceStat", <type>{, <val>, <itemid>}); +function script F_CashReduceStat { + .@type = getarg(0); + .@amount = getarg(1, -1); + .@itemid = getarg(2, 0); + + if ((readparam(.@type) + .@amount) < 1) return; + + if (.@itemid) { + if (countitem(.@itemid)) + delitem .@itemid, 1; + else + return; + } + + StatusPoint += needed_status_point(.@type, .@amount); + statusup2 .@type, .@amount; + + return; +}
\ No newline at end of file diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index 544e3a672..904ed7165 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -203,11 +203,11 @@ function script F_SaveQuestSkills { ADV_QSK = 0; ADV_QSK2 = 0; //1st classes quest skills for (.@i = 0; .@i < 14; ++.@i) { - if(getskilllv(144+.@i)) ADV_QSK |= pow(2,.@i); + if(getskilllv(144+.@i)) ADV_QSK |= (2 ** .@i); } //2nd classes quest skills for (.@i = 0; .@i < 19; ++.@i) { - if(getskilllv(1001+.@i)) ADV_QSK2 |= pow(2,.@i); + if(getskilllv(1001+.@i)) ADV_QSK2 |= (2 ** .@i); } return; } @@ -217,7 +217,7 @@ function script F_SaveQuestSkills { function script F_Load1Skills { //1st classes quest skills for(.@i = 0; .@i < 14; ++.@i) { - if(ADV_QSK|pow(2,.@i) == ADV_QSK) skill 144+.@i,1,0; + if(ADV_QSK|(2 ** .@i) == ADV_QSK) skill 144+.@i,1,0; } ADV_QSK = 0; //Clear var return; @@ -228,60 +228,144 @@ function script F_Load1Skills { function script F_Load2Skills { //2nd classes quest skills for (.@i = 0; .@i < 19; ++.@i) { - if(ADV_QSK2|pow(2,.@i) == ADV_QSK2) skill 1001+.@i,1,0; + if(ADV_QSK2|(2 ** .@i) == ADV_QSK2) skill 1001+.@i,1,0; } ADV_QSK2 = 0; //Clear var return; } //== Function F_GetWeaponType ============================== -// Determines weapon type by view +// Determines weapon type by subtype function script F_GetWeaponType { - switch(getiteminfo(getarg(0),11)) { - case 1: return "Dagger"; break; - case 2: return "One-handed Sword"; break; - case 3: return "Two-handed Sword"; break; - case 4: return "One-handed Spear"; break; - case 5: return "Two-handed Spear"; break; - case 6: return "One-handed Axe"; break; - case 7: return "Two-handed Axe"; break; - case 8: return "Mace"; break; - //case 9: return "Unused"; break; - case 10: return "Staff"; break; - case 11: return "Bow"; break; - case 12: return "Knuckle"; break; - case 13: return "Instrument"; break; - case 14: return "Whip"; break; - case 15: return "Book"; break; - case 16: return "Katar"; break; - case 17: return "Revolver"; break; - case 18: return "Rifle"; break; - case 19: return "Gatling gun"; break; - case 20: return "Shotgun"; break; - case 21: return "Grenade Launcher"; break; - case 22: return "Shuriken"; break; + if (getiteminfo(getarg(0), ITEMINFO_TYPE) != IT_WEAPON) + return "Not a weapon"; + + switch (getiteminfo(getarg(0), ITEMINFO_SUBTYPE)) { + case W_DAGGER: return "Dagger"; break; + case W_1HSWORD: return "One-handed Sword"; break; + case W_2HSWORD: return "Two-handed Sword"; break; + case W_1HSPEAR: return "One-handed Spear"; break; + case W_2HSPEAR: return "Two-handed Spear"; break; + case W_1HAXE: return "One-handed Axe"; break; + case W_2HAXE: return "Two-handed Axe"; break; + case W_MACE: return "Mace"; break; + //case W_2HMACE: return "Two-handed Mace"; break; // Unused + case W_STAFF: return "Staff"; break; + case W_BOW: return "Bow"; break; + case W_KNUCKLE: return "Knuckle"; break; + case W_MUSICAL: return "Instrument"; break; + case W_WHIP: return "Whip"; break; + case W_BOOK: return "Book"; break; + case W_KATAR: return "Katar"; break; + case W_REVOLVER: return "Revolver"; break; + case W_RIFLE: return "Rifle"; break; + case W_GATLING: return "Gatling gun"; break; + case W_SHOTGUN: return "Shotgun"; break; + case W_GRENADE: return "Grenade Launcher"; break; + case W_HUUMA: return "Shuriken"; break; + case W_2HSTAFF: return "Two-handed Staff"; break; default: return "Unable to Determine Equip Type"; break; } end; } +//== Function F_GetAmmoType ================================ +// Determines ammunition type by subtype +function script F_GetAmmoType { + if (getiteminfo(getarg(0), ITEMINFO_TYPE) != IT_AMMO) + return "Not an ammunition"; + + switch (getiteminfo(getarg(0), ITEMINFO_SUBTYPE)) { + case A_ARROW: return "Arrow"; break; + case A_DAGGER: return "Throwing Dagger"; break; + case A_BULLET: return "Bullet"; break; + case A_SHELL: return "Shell"; break; + case A_GRENADE: return "Grenade"; break; + case A_SHURIKEN: return "Huuma Shuriken"; break; + case A_KUNAI: return "Kunai"; break; + case A_CANNONBALL: return "Cannon Ball"; break; + case A_THROWWEAPON: return "Throwing Weapon"; break; + default: return "Unable to Determine Ammunition Type"; break; + } + end; +} + //== Function F_GetArmorType =============================== // Determines equipment type by equip location function script F_GetArmorType { - switch(getiteminfo(getarg(0),5)) { - case 001: return "Lower Headgear"; break; - case 2: return "Weapon"; break; - case 4: return "Garment"; break; - case 8: return "Accessory"; break; - case 16: return "Armor"; break; - case 32: return "Shield"; break; - case 64: return "Shoes"; break; - case 128: return "Accessory"; break; - case 256: return "Upper Headgear"; break; - case 512: return "Middle Headgear"; break; - default: return "Unable to Determine Equip Location"; break; + switch (getiteminfo(getarg(0), ITEMINFO_TYPE)) { + case IT_WEAPON: + return callfunc("F_GetWeaponType", getarg(0)); + case IT_AMMO: + return callfunc("F_GetAmmoType", getarg(0)); + case IT_ARMOR: + break; + default: + return "Unknown Equip Type"; } - end; + + .@loc = getiteminfo(getarg(0), ITEMINFO_LOC); + + if ((.@loc & EQP_HELM) != 0) { + .@name$ = ""; + if ((.@loc & EQP_HEAD_TOP) != 0) { + .@name$ += "Top"; + } + if ((.@loc & EQP_HEAD_MID) != 0) { + if ((.@loc & EQP_HEAD_TOP) != 0) + .@name$ += " + "; + .@name$ += "Middle"; + } + if ((.@loc & EQP_HEAD_LOW) != 0) { + if ((.@loc & (EQP_HEAD_TOP | EQP_HEAD_MID)) != 0) + .@name$ += " + "; + .@name$ += "Lower"; + } + .@name$ += " Headgear"; + return .@name$; + } + if ((.@loc & EQP_GARMENT) != 0) + return "Garment"; + if ((.@loc & EQP_ACC) != 0) + return "Accessory"; + if ((.@loc & EQP_ARMOR) != 0) + return "Armor"; + if ((.@loc & EQP_SHIELD) != 0) + return "Shield"; + if ((.@loc & EQP_SHOES) != 0) + return "Shoes"; + if ((.@loc & EQP_COSTUE_GARMENT) != 0) + return "Costume Garment"; + if ((.@loc & EQP_COSTUME) != 0) { + .@name = "Costume "; + if ((.@loc & EQP_COSTUME_HEAD_TOP) != 0) { + .@name$ += "Top"; + } + if ((.@loc & EQP_COSTUME_HEAD_MID) != 0) { + if ((.@loc & EQP_COSTUME_HEAD_TOP) != 0) + .@name$ += " + "; + .@name$ += "Middle"; + } + if ((.@loc & EQP_COSTUME_HEAD_LOW) != 0) { + if ((.@loc & (EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID)) != 0) + .@name$ += " + "; + .@name$ += "Lower"; + } + .@name$ += " Headgear"; + return .@name$; + } + if ((.@loc & EQP_SHADOW_ARMOR) != 0) + return "Shadow Armor"; + if ((.@loc & EQP_SHADOW_WEAPON) != 0) + return "Shadow Weapon"; + if ((.@loc & EQP_SHADOW_SHIELD) != 0) + return "Shadow Shield"; + if ((.@loc & EQP_SHADOW_SHOES) != 0) + return "Shadow Shoes"; + if ((.@loc & EQP_SHADOW_ACC) != 0) + return "Shadow Accessory"; + + return "Unknown Equip Type"; } //== Function Time2Str ===================================== @@ -354,3 +438,40 @@ function script F_ShuffleNumbers { function script F_MesColor { return sprintf("^%06X", min(getarg(0), 0xFFFFFF)); } + +//== Function F_GetTradeRestriction ======================== +// Function to get item trade restriction +// Examples: +// mes "Red Potion Restriction: "+ callfunc("F_GetTradeRestriction", Red_Potion); +function script F_GetTradeRestriction { + .@trade = getiteminfo(getarg(0), ITEMINFO_TRADE); + + if (.@trade == 0) { + return "None"; + } + .@trade$ = ""; + if (.@trade & ITR_NODROP) { + .@trade$ += "NoDrop|"; + } + if (.@trade & ITR_NOTRADE) { + .@trade$ += "NoTrade|"; + } + if (.@trade & ITR_PARTNEROVERRIDE) { + .@trade$ += "PartnerOverride|"; + } + if (.@trade & ITR_NOSELLTONPC) { + .@trade$ += "NoSellToNpc|"; + } + if (.@trade & ITR_NOSTORAGE) { + .@trade$ += "NoStorage|"; + } + if (.@trade & ITR_NOGSTORAGE) { + .@trade$ += "NoGuildStorage|"; + } + if (.@trade & ITR_NOMAIL) { + .@trade$ += "NoMail|"; + } + if (.@trade & ITR_NOAUCTION) { + .@trade$ += "NoAuction|"; + } +} diff --git a/npc/other/acolyte_warp.txt b/npc/other/acolyte_warp.txt index 1b5404a78..256c2d802 100644 --- a/npc/other/acolyte_warp.txt +++ b/npc/other/acolyte_warp.txt @@ -75,9 +75,9 @@ prontera,98,121,4 script Acolyte#Prtclear 4_F_01,{ mes "to "+.@towns$[.@i]+" is "+.@cost[.@i]+" zeny."; close; } - specialeffect2 EF_READYPORTAL; - specialeffect2 EF_TELEPORTATION; - specialeffect2 EF_PORTAL; + specialeffect(EF_READYPORTAL, AREA, playerattached()); + specialeffect(EF_TELEPORTATION, AREA, playerattached()); + specialeffect(EF_PORTAL, AREA, playerattached()); next; Zeny -= .@cost[.@i]; switch(.@i) { @@ -138,9 +138,9 @@ yuno,142,184,6 script Acolyte#Junoclear 4_F_01,{ mes "to "+.@towns$[.@i]+" is "+.@cost[.@i]+" zeny."; close; } - specialeffect2 EF_READYPORTAL; - specialeffect2 EF_TELEPORTATION; - specialeffect2 EF_PORTAL; + specialeffect(EF_READYPORTAL, AREA, playerattached()); + specialeffect(EF_TELEPORTATION, AREA, playerattached()); + specialeffect(EF_PORTAL, AREA, playerattached()); next; Zeny -= .@cost[.@i]; switch(.@i) { diff --git a/npc/other/arena/arena_aco.txt b/npc/other/arena/arena_aco.txt index 0c46eea21..99971eecd 100644 --- a/npc/other/arena/arena_aco.txt +++ b/npc/other/arena/arena_aco.txt @@ -1089,7 +1089,7 @@ prt_are_in,181,83,3 script Staff#aco-1 1_F_02,{ mes "I hope you enjoyed"; mes "your battle in the area~"; close2; - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -1289,7 +1289,7 @@ prt_are_in,25,31,3 script Staff#aco-2 1_F_02,{ close2; arena_point += 50; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; donpcevent "#arn_timer_aco::OnStop"; donpcevent "allkill#aco::OnEnable"; @@ -1353,7 +1353,7 @@ prt_are_in,25,31,3 script Staff#aco-2 1_F_02,{ close2; arena_point += 20; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; donpcevent "#arn_timer_aco::OnStop"; donpcevent "allkill#aco::OnEnable"; @@ -1451,7 +1451,7 @@ prt_are_in,25,31,3 script Staff#aco-2 1_F_02,{ close2; arena_point += 20; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; donpcevent "#arn_timer_aco::OnStop"; donpcevent "allkill#aco::OnEnable"; diff --git a/npc/other/arena/arena_lvl50.txt b/npc/other/arena/arena_lvl50.txt index fbd2ba193..32bd12178 100644 --- a/npc/other/arena/arena_lvl50.txt +++ b/npc/other/arena/arena_lvl50.txt @@ -818,7 +818,7 @@ prt_are_in,129,188,3 script Staff#50-1 1_F_02,{ mes "[Staff]"; mes "Let me guide you outside. I hope you had a good time."; close2; - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -884,7 +884,7 @@ prt_are_in,25,188,3 script Staff#50-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); donpcevent "cast#50::OnNomal1"; warp "arena_room",100,75; donpcevent "#arn_timer_50::OnStop"; @@ -931,7 +931,7 @@ prt_are_in,25,188,3 script Staff#50-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); donpcevent "cast#50::OnNomal2"; warp "arena_room",100,75; donpcevent "#arn_timer_50::OnStop"; diff --git a/npc/other/arena/arena_lvl60.txt b/npc/other/arena/arena_lvl60.txt index b81831345..30734f043 100644 --- a/npc/other/arena/arena_lvl60.txt +++ b/npc/other/arena/arena_lvl60.txt @@ -828,7 +828,7 @@ prt_are_in,129,135,3 script Staff#60-1 1_F_02,{ mes "[Staff]"; mes "Let me guide you outside. I hope you had a good time."; close2; - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -894,7 +894,7 @@ prt_are_in,25,135,3 script Staff#60-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); donpcevent "cast#60::OnNomal1"; warp "arena_room",100,75; donpcevent "#arn_timer_60::OnStop"; @@ -941,7 +941,7 @@ prt_are_in,25,135,3 script Staff#60-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); donpcevent "cast#60::OnNomal2"; warp "arena_room",100,75; donpcevent "#arn_timer_60::OnStop"; diff --git a/npc/other/arena/arena_lvl70.txt b/npc/other/arena/arena_lvl70.txt index c862585aa..9a0c26aa3 100644 --- a/npc/other/arena/arena_lvl70.txt +++ b/npc/other/arena/arena_lvl70.txt @@ -793,7 +793,7 @@ prt_are_in,129,83,3 script Staff#70-1 1_F_02,{ mes "[Staff]"; mes "Let me guide you outside. I hope you had a good time."; close2; - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -859,7 +859,7 @@ prt_are_in,25,84,3 script Staff#70-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); donpcevent "cast#70::OnNomal1"; warp "arena_room",100,75; donpcevent "#arn_timer_70::OnStop"; @@ -906,7 +906,7 @@ prt_are_in,25,84,3 script Staff#70-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); donpcevent "cast#70::OnNomal2"; warp "arena_room",100,75; donpcevent "#arn_timer_70::OnStop"; diff --git a/npc/other/arena/arena_lvl80.txt b/npc/other/arena/arena_lvl80.txt index 044b1eb31..3bb1cf43a 100644 --- a/npc/other/arena/arena_lvl80.txt +++ b/npc/other/arena/arena_lvl80.txt @@ -774,7 +774,7 @@ prt_are_in,181,188,3 script Staff#80-1 1_F_02,{ mes "[Staff]"; mes "Let me guide you outside. I hope you had a good time."; close2; - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -840,7 +840,7 @@ prt_are_in,77,187,3 script Staff#80-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_EXIT; + specialeffect(EF_EXIT, AREA, playerattached()); donpcevent "cast#80::OnNomal1"; warp "arena_room",100,75; donpcevent "#arn_timer_80::OnStop"; @@ -887,7 +887,7 @@ prt_are_in,77,187,3 script Staff#80-2 1_F_02,{ mes "See you later~"; close2; } - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); donpcevent "cast#80::OnNomal2"; warp "arena_room",100,75; donpcevent "#arn_timer_80::OnStop"; diff --git a/npc/other/arena/arena_party.txt b/npc/other/arena/arena_party.txt index d7865d441..c3133af30 100644 --- a/npc/other/arena/arena_party.txt +++ b/npc/other/arena/arena_party.txt @@ -986,7 +986,7 @@ prt_are_in,181,135,3 script Staff#party-1 1_F_02,{ mes "[Staff]"; mes "Let me guide you outside. I hope you had a good time."; close2; - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); warp "arena_room",100,75; end; } @@ -1058,7 +1058,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ donpcevent "alloff#pt::OnEnable"; donpcevent "Ponox::OnStart"; } - specialeffect2 EH_HIT5; + specialeffect(EH_HIT5, AREA, playerattached()); donpcevent "cast#pt::OnNomal1"; warp "arena_room",100,75; end; @@ -1136,7 +1136,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ donpcevent "alloff#pt::OnEnable"; donpcevent "Ponox::OnStart"; } - specialeffect2 EF_HIT5; + specialeffect(EF_HIT5, AREA, playerattached()); warp "arena_room",100,75; end; } diff --git a/npc/other/comodo_gambling.txt b/npc/other/comodo_gambling.txt index 89a2b0e8a..bd2b0d692 100644 --- a/npc/other/comodo_gambling.txt +++ b/npc/other/comodo_gambling.txt @@ -541,13 +541,13 @@ mjolnir_02,85,362,3 script Blacksmith Miner 4_F_JOB_BLACKSMITH,{ mes "please enter '0' to cancel."; next; input .@amount; - if (.@amount == 0){ + if (.@amount == 0) { mes "[Dwayne]"; mes "Alright, you've"; mes "canceled the trade."; mes "Take care!"; close; - }else if (.@amount < 1 || .@amount > 500){ + } else if (.@amount < 1 || .@amount > 500){ mes "[Dwayne]"; mes "The maximum"; mes "amount is 500."; @@ -555,8 +555,7 @@ mjolnir_02,85,362,3 script Blacksmith Miner 4_F_JOB_BLACKSMITH,{ close; } .@cost = .@amount * 55000; - .@weight = .@amount * 100; - if (Zeny < .@cost){ + if (Zeny < .@cost) { mes "[Dwayne]"; mes "Errr..."; mes "I'm sorry, but you"; @@ -565,7 +564,7 @@ mjolnir_02,85,362,3 script Blacksmith Miner 4_F_JOB_BLACKSMITH,{ mes "I sell them at that price."; close; } - if (Weight < .@weight){ + if (!checkweight(Crystal_Jewel__, .@amount)) { mes "[Dwayne]"; mes "Errr..."; mes "You're carrying too many items."; @@ -573,7 +572,7 @@ mjolnir_02,85,362,3 script Blacksmith Miner 4_F_JOB_BLACKSMITH,{ close; } Zeny -= .@cost; - getitem 732,.@amount; + getitem(Crystal_Jewel__, .@amount); mes "[Dwayne]"; mes "Thank you for"; mes "buying my diamonds!"; diff --git a/npc/other/divorce.txt b/npc/other/divorce.txt index e3d6f5ee7..f490df2f9 100644 --- a/npc/other/divorce.txt +++ b/npc/other/divorce.txt @@ -208,7 +208,7 @@ nif_in,190,112,5 script Deviruchi#divorce 4_DEVIRUCHI,{ mes "^FF0000for the rest of your life.^000000"; next; specialeffect EF_MAGICROD; - specialeffect2 EF_DEVIL; + specialeffect(EF_DEVIL, AREA, playerattached()); wedding_sign = 0; Zeny -= 2500000; Sp = 0; diff --git a/npc/other/gympass.txt b/npc/other/gympass.txt index d30fafeb8..50f7b18f7 100644 --- a/npc/other/gympass.txt +++ b/npc/other/gympass.txt @@ -80,13 +80,13 @@ payon,173,141,4 script Ripped Cabus#GymPass 4_M_HUMAN_02,{ mes "and try to feel the burn."; mes "Ready? Let's do this."; next; - specialeffect2 EF_EARTHSPIKE; + specialeffect(EF_EARTHSPIKE, AREA, playerattached()); next; - specialeffect2 EF_DEVIL; + specialeffect(EF_DEVIL, AREA, playerattached()); next; - specialeffect2 EF_COIN; + specialeffect(EF_COIN, AREA, playerattached()); next; - specialeffect2 EF_SIGHTRASHER; + specialeffect(EF_SIGHTRASHER, AREA, playerattached()); next; mes "[Ripped]"; mes "There, you should be able"; @@ -139,13 +139,13 @@ payon,173,141,4 script Ripped Cabus#GymPass 4_M_HUMAN_02,{ mes "as muscle memory. It's won't take"; mes "as long to build 'em back up..."; next; - specialeffect2 EF_EARTHSPIKE; + specialeffect(EF_EARTHSPIKE, AREA, playerattached()); next; - specialeffect2 EF_DEVIL; + specialeffect(EF_DEVIL, AREA, playerattached()); next; - specialeffect2 EF_COIN; + specialeffect(EF_COIN, AREA, playerattached()); next; - specialeffect2 EF_SIGHTRASHER; + specialeffect(EF_SIGHTRASHER, AREA, playerattached()); next; mes "[Ripped]"; mes "How about that?"; diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt index 965405807..9c7b87ee4 100644 --- a/npc/other/hugel_bingo.txt +++ b/npc/other/hugel_bingo.txt @@ -96,26 +96,25 @@ OnTouch: @bingo_e4$ = 0; @bingo_e5$ = 0; @bingo_case = 1; -L_Fill: - @bingo_fill = callfunc("Func_Bingo",@bingo_case); - if (!@bingo_fill) { - mes "The numbers you have entered"; - mes "exceed the limit, or you have"; - mes "already entered these numbers."; - mes "Please enter your numbers again."; - next; - } else if (@bingo_fill) { - if(@bingoplate[25] < 10) @bingo_e5$ = "0"+@bingoplate[25]+""; else @bingo_e5$ = @bingoplate[25]; - donpcevent "start#bingo::OnEnter"; - mes "["+@bingo_a1$+"] ["+@bingo_a2$+"] ["+@bingo_a3$+"] ["+@bingo_a4$+"] ["+@bingo_a5$+"]"; - mes "["+@bingo_b1$+"] ["+@bingo_b2$+"] ["+@bingo_b3$+"] ["+@bingo_b4$+"] ["+@bingo_b5$+"]"; - mes "["+@bingo_c1$+"] ["+@bingo_c2$+"] ["+@bingo_c3$+"] ["+@bingo_c4$+"] ["+@bingo_c5$+"]"; - mes "["+@bingo_d1$+"] ["+@bingo_d2$+"] ["+@bingo_d3$+"] ["+@bingo_d4$+"] ["+@bingo_d5$+"]"; - mes "["+@bingo_e1$+"] ["+@bingo_e2$+"] ["+@bingo_e3$+"] ["+@bingo_e4$+"] ["+@bingo_e5$+"]"; - close; - + while (true) { + @bingo_fill = callfunc("Func_Bingo",@bingo_case); + if (!@bingo_fill) { + mes "The numbers you have entered"; + mes "exceed the limit, or you have"; + mes "already entered these numbers."; + mes "Please enter your numbers again."; + next; + } else if (@bingo_fill) { + if(@bingoplate[25] < 10) @bingo_e5$ = "0"+@bingoplate[25]+""; else @bingo_e5$ = @bingoplate[25]; + donpcevent "start#bingo::OnEnter"; + mes "["+@bingo_a1$+"] ["+@bingo_a2$+"] ["+@bingo_a3$+"] ["+@bingo_a4$+"] ["+@bingo_a5$+"]"; + mes "["+@bingo_b1$+"] ["+@bingo_b2$+"] ["+@bingo_b3$+"] ["+@bingo_b4$+"] ["+@bingo_b5$+"]"; + mes "["+@bingo_c1$+"] ["+@bingo_c2$+"] ["+@bingo_c3$+"] ["+@bingo_c4$+"] ["+@bingo_c5$+"]"; + mes "["+@bingo_d1$+"] ["+@bingo_d2$+"] ["+@bingo_d3$+"] ["+@bingo_d4$+"] ["+@bingo_d5$+"]"; + mes "["+@bingo_e1$+"] ["+@bingo_e2$+"] ["+@bingo_e3$+"] ["+@bingo_e4$+"] ["+@bingo_e5$+"]"; + close; + } } - goto L_Fill; } que_bingo,53,121,0 duplicate(plate1#bingo) plate2#bingo HIDDEN_WARP_NPC,1,1 diff --git a/npc/other/inventory_expansion.txt b/npc/other/inventory_expansion.txt new file mode 100644 index 000000000..db18e09e1 --- /dev/null +++ b/npc/other/inventory_expansion.txt @@ -0,0 +1,63 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2018 Hercules Dev Team +//= Copyright (C) 4144 +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Inventory expansion +//========================================================================= + +- script inventory_expansion FAKE_NPC,{ + end; + +OnInvExpandRequest: + if (countitem(Inventory_Extension_Coupon) < 1) { + expandInventoryAck(EXPAND_INV_MISSING_ITEM); + end; + } + if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) { + expandInventoryAck(EXPAND_INV_MAX_SIZE); + end; + } + expandInventoryAck(EXPAND_INV_ASK_CONFIRMATION, Inventory_Extension_Coupon); + end; + +OnInvExpandConfirmed: + if (countitem(Inventory_Extension_Coupon) < 1) { + expandInventoryResult(EXPAND_INV_RESULT_MISSING_ITEM); + end; + } + if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) { + expandInventoryResult(EXPAND_INV_RESULT_MAX_SIZE); + end; + } + delitem(Inventory_Extension_Coupon, 1); + if (expandInventory(INVENTORY_INCREASE_STEP) == true) { + expandInventoryResult(EXPAND_INV_RESULT_SUCCESS); + } + end; + +OnInvExpandRejected: + end; +} diff --git a/npc/other/marriage.txt b/npc/other/marriage.txt index bbd659420..0f640af2a 100644 --- a/npc/other/marriage.txt +++ b/npc/other/marriage.txt @@ -58,7 +58,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "married. For now, why"; mes "don't you enjoy the simple"; mes "pleasures of childhood?"; - goto L_End; + callsub L_End; } mes "[Marry Happy]"; mes "Oh, of course you"; @@ -67,7 +67,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "are too many laws against"; mes "that~ Aren't you the most"; mes "adorable little thing?"; - goto L_End; + callsub L_End; } mes "[Marry Happy]"; mes "Marriage is the beautiful"; @@ -166,7 +166,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "If there was something"; mes "you didn't understand,"; mes "feel free to ask me again."; - goto L_End; + callsub L_End; } mes "[Marry Happy]"; mes "The easiest way to write"; @@ -262,7 +262,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "you can consider marriage."; mes "After you grow stronger,"; mes "come and talk to me again."; - goto L_End; + callsub L_End; } else if (countitem(Diamond_Ring) < 1) { mes "[Marry Happy]"; @@ -272,7 +272,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "during the wedding ceremony?"; mes "Look for it carefully and come"; mes "back after you find it, okay?"; - goto L_End; + callsub L_End; } else if (Sex == SEX_MALE) { if (Zeny < 1300000) { mes "[Marry Happy]"; @@ -281,7 +281,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "that all grooms must pay"; mes "for the wedding ceremony."; mes "Did you misplace your money?"; - goto L_End; + callsub L_End; } else if (countitem(Tuxedo) < 1) { mes "[Marry Happy]"; @@ -291,7 +291,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "ceremony! Find it, bring it"; mes "to me, and then we can finally"; mes "begin the wedding, okay?"; - goto L_End; + callsub L_End; } } else if (Sex == SEX_FEMALE) { if (Zeny < 1200000) { @@ -302,7 +302,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "wedding ceremony. Perhaps"; mes "you could ask your partner"; mes "to help you with the funds?"; - goto L_End; + callsub L_End; } else if (countitem(Wedding_Dress) < 1) { mes "[Marry Happy]"; @@ -312,7 +312,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ mes "bring it to me-- you"; mes "absolutely need it"; mes "for the wedding!"; - goto L_End; + callsub L_End; } } mes "[Marry Happy]"; @@ -379,7 +379,7 @@ prt_church,97,100,4 script Wedding Staff#w 1_F_LIBRARYGIRL,{ } delitem Diamond_Ring,1; wedding_sign = 1; - goto L_End; + callsub L_End; } mes "[Marry Happy]"; mes "No...?"; @@ -626,7 +626,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "It's old fashioned protocol,"; mes "but I'll admit that it does"; mes "keep things running smoothly."; - goto L_End; + callsub L_End; } mes "[Vomars]"; mes "Before you can be"; @@ -635,7 +635,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "two with your partner."; mes "Then, we can proceed"; mes "with the ceremony."; - goto L_End; + callsub L_End; } mes "[Vomars]"; mes "You must apply for"; @@ -644,7 +644,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "Happy Marry will let you know"; mes "what else you'll need to do"; mes "to prepare for marriage."; - goto L_End; + callsub L_End; } else if ($@wedding == 1) { if (wedding_sign == 1) { @@ -734,7 +734,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "the ceremony has finished"; mes "Please try again once he's"; mes "returned."; - goto L_End; + callsub L_End; } else { cutin "wedding_bomars03",2; @@ -769,7 +769,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "application. Please speak"; mes "to her so that we can begin"; mes "the wedding ceremony."; - goto L_End; + callsub L_End; } callsub S_Busy; } @@ -796,14 +796,14 @@ S_Busy: mes "Mister "+ $@wed_groom$; mes "is currently in progress."; mes "Please keep your voice down."; - goto L_End; + callsub L_End; } mes "[Vomars]"; mes "I'm conducting a wedding"; mes "for another couple now, so"; mes "please wait patiently for your"; mes "turn. Thanks for understanding... "; - goto L_End; + callsub L_End; OnStop: stopnpctimer; diff --git a/npc/other/monster_race.txt b/npc/other/monster_race.txt index 9ddafeef5..9e938c663 100644 --- a/npc/other/monster_race.txt +++ b/npc/other/monster_race.txt @@ -2635,7 +2635,7 @@ S_BonusReward: mes "me a reward later?"; next; mes "[Ei'felle]"; - if (!getiteminfo(.@arg1,13)) { //use item level to determine if the item is armor (no weapon level) + if (!getiteminfo(.@arg1, ITEMINFO_WLV)) { // use item level to determine if the item is armor (no weapon level) mes "Of course, of course."; mes "Remember, if you donate"; mes "more medals to me, then"; diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt index b3e0eb15a..326c601be 100644 --- a/npc/other/poring_war.txt +++ b/npc/other/poring_war.txt @@ -1052,7 +1052,7 @@ OnInit: OnEnable: enablenpc "#wop_warp_a"; - specialeffect EF_MAPPILLAR2,AREA,"#wop_warp_a"; + specialeffect(EF_MAPPILLAR2, AREA, getnpcid("#wop_warp_a")); end; OnDisable: @@ -1074,7 +1074,7 @@ OnInit: OnEnable: enablenpc "#wop_warp_d"; - specialeffect EF_MAPPILLAR2,AREA,"#wop_warp_d"; + specialeffect(EF_MAPPILLAR2, AREA, getnpcid("#wop_warp_d")); end; OnDisable: diff --git a/npc/other/private_airship.txt b/npc/other/private_airship.txt new file mode 100644 index 000000000..e650e4b96 --- /dev/null +++ b/npc/other/private_airship.txt @@ -0,0 +1,66 @@ +//================= Hercules Script ======================================= +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2018 Hercules Dev Team +//= Copyright (C) Asheraf +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Private AirShip +//========================================================================= + +- script private_airship FAKE_NPC,{ + end; + +S_AirShipIsNeedItem: + for (.@i = 0; .@i < getarraysize(.needitem); ++.@i) { + if (@itemid == .needitem[.@i]) + return true; + } + return false; + +OnAirShipRequest: + if (callsub(S_AirShipIsNeedItem) == false) { + airship_respond(P_AIRSHIP_ITEM_INVALID); + end; + } + if (countitem(@itemid) < 1) { + airship_respond(P_AIRSHIP_ITEM_NOT_ENOUGH); + end; + } + if (getmapflag(strcharinfo(PC_MAP), mf_pairship_startable) != true) { + airship_respond(P_AIRSHIP_INVALID_START_MAP); + end; + } + if (getmapflag(@mapname$, mf_pairship_endable) != true) { + airship_respond(P_AIRSHIP_INVALID_END_MAP); + end; + } + + delitem(@itemid, 1); + warp(@mapname$, 0, 0); + end; + +OnInit: + setarray(.needitem, 6909, 25464); + end; +} |