Index: scripts/globals/harvest_festivals.lua =================================================================== --- scripts/globals/harvest_festivals.lua (revision 0) +++ scripts/globals/harvest_festivals.lua (working copy) @@ -0,0 +1,235 @@ +--------------------------------------------------------- +--------------------------------------------------------- +------------ Harvest Festivals -------------------- +------------ Author: Metalfiiish -------------------- +--------------------------------------------------------- +--------------------------------------------------------- + +package.loaded["scripts/globals/harvest_festivals"] = nil; +require("scripts/globals/status"); +require("scripts/globals/settings"); + +--------------------------------------------------------- +--------------------------------------------------------- + + +function isHalloweenEnabled() + local option = 0; + if(HALLOWEEN_2005 == 1) then + option = 1; + elseif(HALLOWEEN_2008 == 1) then + option = 2; + elseif(HALLOWEEN_2009 == 1) then + option = 3; + elseif(HALLOWEEN_2010 == 1) then + option = 4; + end + return option; +end; + + + +function playerCostumeCheck(player,npc) +---- Other neat looking halloween type costumes +-- two dragon skins: @420/421 +-- @422 dancing weapon +-- @ 433/432 golem +-- 265 dark eye, 266 Giant version +-- 290 dark bombs +-- 301 dark mandy +-- 313 black spiders +-- 488 gob +-- 531 - 548 shade +-- 564/579 skele + + -- Possible costume values: + Yagudo = math.random(580,607); + Quadav = math.random(644,671); + Shade = math.random(535,538); + Orc = math.random(612,639); + Ghost = 368; + Hound = 365; + Skeleton = 564; + Dark_Stalker = math.random(531,534); + + halloween_costume_list = {Quadav,Orc,Yagudo,Shade,Ghost,Hound,Skeleton,Dark_Stalker}; + + player:addStatusEffect(EFFECT_COSTUME,halloween_costume_list[math.random(1,table.getn(halloween_costume_list)) ],0,3600); + +end; + + +function halloweenItemsCheck(player) + local headSlot = player:getEquipID(SLOT_HEAD); + local mainHand = player:getEquipID(SLOT_MAIN); + local reward = 0; + + -- Normal Quality Rewards + local pumpkinHead = 13916 + local pumpkinHead2 = 15176; + local trickStaff = 17565; + local trickStaff2 = 17587; + + reward_list = {pumpkinHead,pumpkinHead2,trickStaff,trickStaff2}; + + -- Checks for HQ Upgrade + for ri = 1, table.getn(reward_list) do + printf("Checking for HQ"); + if(headSlot == reward_list[ri] or mainHand == reward_list[ri]) then + if(headSlot == pumpkinHead and player:hasItem(13917) == false) then + reward = 13917; -- Horror Head + elseif(headSlot == pumpkinHead2 and player:hasItem(15177) == false) then + reward = 15177; -- Horror Head II + elseif(mainHand == trickStaff and player:hasItem(17566) == false) then + reward = 17566; -- Treat Staff + elseif(mainHand == trickStaff2 and player:hasItem(17588) == false) then + reward = 17588; -- Treat Staff II + end + printf("HQ was %u",reward); + return reward; + end + end + + -- Checks the possible item rewards to ensure player doesnt already have the item we are about to give them + local cnt = table.getn(reward_list); + printf("Cnt starts at: %u",cnt); + printf("Reward List: %u",reward_list[1]); + printf("Reward List: %u",reward_list[2]); + printf("Reward List: %u",reward_list[3]); + printf("Reward List: %u",reward_list[4]); + while cnt ~= 0 do + printf("...in loop..cnt = %u",cnt); + + local picked = reward_list[math.random(1,table.getn(reward_list))]; + printf("Picked reward: %u",picked); + if(player:hasItem(picked) == false) then + printf("Hit if"); + reward = picked; + cnt = 0; + else + printf("Hit else"); + table.remove(reward_list,picked); + cnt = cnt - 1; + end + printf("Item reward: %u",reward); + return reward; + end; +end; + +function onHalloweenTrade(player,trade,npc) + local contentEnabled = isHalloweenEnabled(); + local item = trade:getItem(); + printf("Started with item %u",item); + ------------------- + -- 2005 edition --- + ------------------- + if(contentEnabled == 1) then + printf("Content is eabled!"); + ----------------------------------- + -- Treats allowed + ----------------------------------- + treats_table = {4510, -- Acorn Cookie + 5646, -- Bloody Chocolate + 4496, -- Bubble Chocolate + 4397, -- Cinna-cookie + 4394, -- Ginger Cookie + 4495, -- Goblin Chocolate + 4413, -- Apple Pie + 4488, -- Jack-o'-Pie + 4421, -- Melon Pie + 4563, -- Pamama Tart + 4446, -- Pumpkin Pie + 4414, -- Rolanberry Pie + 4406, -- Baked Apple + 5729, -- Bavarois + 5745, -- Cherry Bavarois + 5653, -- Cherry Muffin + 5655, -- Coffee Muffin + 5718, -- Cream Puff + 5144, -- Crimson Jelly + 5681, -- Cupid Chocolate + 5672, -- Dried Berry + 5567, -- Dried Date + 4556, -- Icecap Rolanberry + 5614, -- Konigskuchen + 5230, -- Love Chocolate + 4502, -- Marron Glace + 4393, -- Orange Kuchen + 5147, -- Snoll Gelato + 4270, -- Sweet Rice Cake + 5645, -- Witch Nougat + 5552, -- Black Pudding + 5550, -- Buche au Chocolat + 5616, -- Lebkuchen House + 5633, -- Chocolate Cake + 5542, -- Gateau aux Fraises + 5572, -- Irmik Helvasi + 5625, -- Maple Cake + 5559, -- Mille Feuille + 5557, -- Mont Blanc + 5629, -- Orange Cake + 5631, -- Pumpkin Cake + 5577, -- Sutlac + 5627}; -- Yogurt Cake + + for itemInList = 1, table.getn(treats_table) do + printf("...running item check..."); + if(item == treats_table[itemInList]) then + + local itemReward = halloweenItemsCheck(player); + + if(itemReward ~= 0 and player:getFreeSlotsCount() >= 1) then -- Math.random added so you have 33% chance on getting item, re-add "and math.random(1,3) < 2" + local TextIDs = "scripts/zones/" .. player:getZoneName() .. "/TextIDs"; + package.loaded[TextIDs] = nil; + require(TextIDs); + player:addItem(itemReward); + player:messageSpecial(ITEM_OBTAINED,itemReward); + elseif(player:canUseCostume()) then + playerCostumeCheck(player,npc); + end + player:tradeComplete(); + break; + end + end + end +end; + +function applyHalloweenNpcCostumes() +-- npcID, skinID (skin ID can be found in mob_change_skin Sql table) + npc_costume_map = {17735787,40, -- Proud_Beard - Bastok Mines + 17735742,41, -- Faustin - Bastok Mines + 17814119,42, -- Aulavia - Bastok Mines + 17735744,43, -- Mille - Bastok Mines + 17735810,44, -- Emaliveulaux - Bastok Mines + 17739805,45, -- Olwyn - Bastok Markets + 17719306,46, -- Apairemant - Southern Sandoria + 17719303,47, -- Machielle - Southern Sandoria + 17719305,48, -- Phamelise - Southern Sandoria + 17719485,49, -- Pourette - Southern Sandoria + 17719304,50, -- Corua -- Southern Sandoria + 17723497,51, -- Attarena - Northern Sandoria + 17723492,52, -- Antonian - Northern Sandoria + 17723487,53, -- Vichuel - Northern Sandoria + 17764401,54, -- Kuzah_Hpirohpon - Windurst Woods + 17764400,55, -- Meriri - Windurst Woods + 17764464,56, -- Nhobi_Zalkia - Windurst Woods + 17764465,57, -- Millerovieunet - Windurst Woods + 17764462,58, -- Taraihi-Perunhi - Windurst Woods + 17752101,59, -- Ness_Rugetomal - Windurst Waters + 17752098,60, -- Upih_Khachla - Windurst Waters + 17752097,61, -- Ensasa - Windurst Waters + 17752103,62, -- Ahyeekih - Windurst Waters + 17752102,63}; -- Maqu_Molpih - Windurst Waters + printf("List made"); + for costumePair = 1, table.getn(npc_costume_map), 2 do + printf("Looping NPC..%u",npc_costume_map[costumePair]); + printf("..with costume..%u",npc_costume_map[costumePair + 1]); + hfNpc = GetNPCByID(npc_costume_map[costumePair]); + printf("In the middle"); + hfNpc:changeSkin(npc_costume_map[costumePair + 1]); + printf("Harvest Festival NPC's have been costume-ized!"); + end +end; + + + Index: scripts/globals/server.lua =================================================================== --- scripts/globals/server.lua (revision 3302) +++ scripts/globals/server.lua (working copy) @@ -4,6 +4,7 @@ -- ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/conquest"); require("scripts/globals/keyitems"); require("scripts/globals/missions"); @@ -25,16 +26,22 @@ if (FIELD_MANUALS == 1) then SetFieldManual(); end + + -- Harvest Festival + if(isHalloweenEnabled() ~= 0) then + applyHalloweenNpcCostumes() + end + SetRegionalConquestOverseers() - -- Charybdis PH alternates, remove one - DespawnMob(17498518); - - -- Timed Spawns - SetTimedSpawns(); - - -- Spawns Silk Caterpillar (temporary until someone implements a way to make it spawn properly) - SpawnMob(17227782,300,660); + -- Charybdis PH alternates, remove one + DespawnMob(17498518); + + -- Timed Spawns + SetTimedSpawns(); + + -- Spawns Silk Caterpillar (temporary until someone implements a way to make it spawn properly) + SpawnMob(17227782,300,660); end; ----------------------------------- Index: scripts/globals/settings.lua =================================================================== --- scripts/globals/settings.lua (revision 3302) +++ scripts/globals/settings.lua (working copy) @@ -143,6 +143,7 @@ SUNBREEZE_2011 = 0; -- Set to 1 to give starting characters Far East dress from 2011. Ex: Hikogami Yukata CHRISTMAS = 0; -- Set to 1 to give starting characters Christmas dress. HALLOWEEN = 0; -- Set to 1 to give starting characters Halloween items. +HALLOWEEN_2005 = 1 -- Set to 1 to Enable the 2005 version of Harvest Festival --MISC HOMEPOINT_HEAL = 0; --Set to 1 if you want Home Points to heal you like in single-player Final Fantasy games. Index: scripts/zones/Bastok_Markets/npcs/Olwyn.lua =================================================================== --- scripts/zones/Bastok_Markets/npcs/Olwyn.lua (revision 3302) +++ scripts/zones/Bastok_Markets/npcs/Olwyn.lua (working copy) @@ -4,6 +4,7 @@ -- Standard Merchant NPC ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/shop"); package.loaded["scripts/zones/Bastok_Markets/TextIDs"] = nil; require("scripts/zones/Bastok_Markets/TextIDs"); @@ -13,26 +14,27 @@ ----------------------------------- function onTrade(player,npc,trade) -end; + onHalloweenTrade(player,trade,npc) +end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) - + player:showText(npc,OLWYN_SHOP_DIALOG); -stock = {0x1020,445,1, -- Ether +stock = {0x1020,445,1, -- Ether - 0x1037,736,2, -- Echo Drops - 0x1010,837,2, -- Potion + 0x1037,736,2, -- Echo Drops + 0x1010,837,2, -- Potion - 0x1036,2387,3, -- Eye Drops - 0x1034,290,3} -- Antidote + 0x1036,2387,3, -- Eye Drops + 0x1034,290,3} -- Antidote showNationShop(player, BASTOK, stock); -end; +end; ----------------------------------- -- onEventUpdate @@ -51,6 +53,3 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; - - - Index: scripts/zones/Bastok_Mines/npcs/Aulavia.lua =================================================================== --- scripts/zones/Bastok_Mines/npcs/Aulavia.lua (revision 3302) +++ scripts/zones/Bastok_Mines/npcs/Aulavia.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- -- Area: Bastok Mines -- NPC: Aulavia --- Regional Marchant NPC +-- Regional Marchant NPC -- Only sells when Bastok controls Vollbow. ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc) end; ----------------------------------- @@ -25,19 +27,19 @@ RegionOwner = GetRegionOwner(VOLLBOW); -if (RegionOwner ~= BASTOK) then - player:showText(npc,AULAVIA_CLOSED_DIALOG); +if (RegionOwner ~= BASTOK) then + player:showText(npc,AULAVIA_CLOSED_DIALOG); else - player:showText(npc,AULAVIA_OPEN_DIALOG); + player:showText(npc,AULAVIA_OPEN_DIALOG); - stock = {0x27c,119, --Chamomile - 0x360,88, --Fish Scales - 0x3a8,14, --Rock Salt - 0x582,1656} --Sweet William - -showShop(player,BASTOK,stock); + stock = {0x27c,119, --Chamomile + 0x360,88, --Fish Scales + 0x3a8,14, --Rock Salt + 0x582,1656} --Sweet William + +showShop(player,BASTOK,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -57,5 +59,3 @@ --printf("RESULT: %u",option); end; - - Index: scripts/zones/Bastok_Mines/npcs/Emaliveulaux.lua =================================================================== --- scripts/zones/Bastok_Mines/npcs/Emaliveulaux.lua (revision 3302) +++ scripts/zones/Bastok_Mines/npcs/Emaliveulaux.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Bastok Mines --- NPC: Emaliveulaux --- Only sells when Bastok controls the Tavnazian Archipelago --- Only available to those with CoP Ch. 4.1 or higher +-- Area: Bastok Mines +-- NPC: Emaliveulaux +-- Only sells when Bastok controls the Tavnazian Archipelago +-- Only available to those with CoP Ch. 4.1 or higher ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc) end; ----------------------------------- @@ -27,20 +29,20 @@ cop = 40; --player:getVar("chainsOfPromathiaMissions"); if (cop >= 40) then - if (RegionOwner ~= BASTOK) then - player:showText(npc,EMALIVEULAUX_CLOSED_DIALOG); - else - player:showText(npc,EMALIVEULAUX_OPEN_DIALOG); + if (RegionOwner ~= BASTOK) then + player:showText(npc,EMALIVEULAUX_CLOSED_DIALOG); + else + player:showText(npc,EMALIVEULAUX_OPEN_DIALOG); - stock = {0x05f3,290, --Apple Mint - 0x142c,1945, --Ground Wasabi - 0x426d,99, --Lufaise Fly - 0x144b,233} --Misareaux Parsley - - showShop(player,BASTOK,stock); - end + stock = {0x05f3,290, --Apple Mint + 0x142c,1945, --Ground Wasabi + 0x426d,99, --Lufaise Fly + 0x144b,233} --Misareaux Parsley + + showShop(player,BASTOK,stock); + end else - player:showText(npc,EMALIVEULAUX_COP_NOT_COMPLETED); + player:showText(npc,EMALIVEULAUX_COP_NOT_COMPLETED); end end; @@ -62,5 +64,3 @@ --printf("RESULT: %u",option); end; - - Index: scripts/zones/Bastok_Mines/npcs/Faustin.lua =================================================================== --- scripts/zones/Bastok_Mines/npcs/Faustin.lua (revision 3302) +++ scripts/zones/Bastok_Mines/npcs/Faustin.lua (working copy) @@ -1,9 +1,10 @@ ----------------------------------- --- Area: Bastok_Mines --- NPC: Faustin --- Only sells when Bastok controlls Ronfaure Region +-- Area: Bastok_Mines +-- NPC: Faustin +-- Only sells when Bastok controlls Ronfaure Region ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; @@ -14,6 +15,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc) end; ----------------------------------- @@ -24,19 +26,19 @@ RegionOwner = GetRegionOwner(RONFAURE); -if (RegionOwner ~= BASTOK) then - player:showText(npc,FAUSTIN_CLOSED_DIALOG); +if (RegionOwner ~= BASTOK) then + player:showText(npc,FAUSTIN_CLOSED_DIALOG); else - player:showText(npc,FAUSTIN_OPEN_DIALOG); - - stock = {0x1125,29, -- San d'Orian Carrot - 0x114f,69, -- San d'Orian Grape - 0x027f,110, -- Chestnut - 0x0262,55} -- San d'Orian Flour - + player:showText(npc,FAUSTIN_OPEN_DIALOG); + + stock = {0x1125,29, -- San d'Orian Carrot + 0x114f,69, -- San d'Orian Grape + 0x027f,110, -- Chestnut + 0x0262,55} -- San d'Orian Flour + showShop(player,BASTOK,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -55,6 +57,3 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; - - - Index: scripts/zones/Bastok_Mines/npcs/Mille.lua =================================================================== --- scripts/zones/Bastok_Mines/npcs/Mille.lua (revision 3302) +++ scripts/zones/Bastok_Mines/npcs/Mille.lua (working copy) @@ -1,9 +1,10 @@ ----------------------------------- --- Area: Bastok_Mines --- NPC: Mille --- Only sells when Bastok controlls Norvallen Region +-- Area: Bastok_Mines +-- NPC: Mille +-- Only sells when Bastok controlls Norvallen Region ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil; @@ -14,6 +15,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc) end; ----------------------------------- @@ -24,19 +26,19 @@ RegionOwner = GetRegionOwner(NORVALLEN); -if (RegionOwner ~= BASTOK) then - player:showText(npc,MILLE_CLOSED_DIALOG); +if (RegionOwner ~= BASTOK) then + player:showText(npc,MILLE_CLOSED_DIALOG); else - player:showText(npc,MILLE_OPEN_DIALOG); - - stock = {0x02b0,18, --Arrowwood Log - 0x026d,25, --Crying Mustard - 0x026a,25, --Blue Peas - 0x02ba,88} --Ash Log + player:showText(npc,MILLE_OPEN_DIALOG); + + stock = {0x02b0,18, --Arrowwood Log + 0x026d,25, --Crying Mustard + 0x026a,25, --Blue Peas + 0x02ba,88} --Ash Log showShop(player,BASTOK,stock); end -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Northern_San_dOria/npcs/Antonian.lua =================================================================== --- scripts/zones/Northern_San_dOria/npcs/Antonian.lua (revision 3302) +++ scripts/zones/Northern_San_dOria/npcs/Antonian.lua (working copy) @@ -1,12 +1,13 @@ ----------------------------------- -- Area: Northern San d'Oria -- NPC: Antonian --- Regional Marchant NPC +-- Regional Marchant NPC -- Only sells when San d'Oria controlls Aragoneu. ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -18,15 +19,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -38,20 +37,20 @@ RegionOwner = GetRegionOwner(ARAGONEU); - if(RegionOwner ~= SANDORIA) then - player:showText(npc,ANTONIAN_CLOSED_DIALOG); - else - player:showText(npc,ANTONIAN_OPEN_DIALOG); + if(RegionOwner ~= SANDORIA) then + player:showText(npc,ANTONIAN_CLOSED_DIALOG); + else + player:showText(npc,ANTONIAN_OPEN_DIALOG); - stock = {0x0277,36, --Horo Flour - 0x0275,43, --Millioncorn - 0x113f,111, --Roasted Corn - 0x0349,36, --Yagudo Feather - 0x1199,90} --Sunflower Seeds - - showShop(player,SANDORIA,stock); - end -end; + stock = {0x0277,36, --Horo Flour + 0x0275,43, --Millioncorn + 0x113f,111, --Roasted Corn + 0x0349,36, --Yagudo Feather + 0x1199,90} --Sunflower Seeds + + showShop(player,SANDORIA,stock); + end +end; ----------------------------------- -- onEventUpdate @@ -70,7 +69,3 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; - - - - Index: scripts/zones/Northern_San_dOria/npcs/Attarena.lua =================================================================== --- scripts/zones/Northern_San_dOria/npcs/Attarena.lua (revision 3302) +++ scripts/zones/Northern_San_dOria/npcs/Attarena.lua (working copy) @@ -1,11 +1,12 @@ ----------------------------------- --- Area: Northern San d'Oria --- NPC: Attarena --- Only sells when San d'Oria controlls Li'Telor Region +-- Area: Northern San d'Oria +-- NPC: Attarena +-- Only sells when San d'Oria controlls Li'Telor Region ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -17,15 +18,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -37,17 +36,17 @@ RegionOwner = GetRegionOwner(LITELOR); - if (RegionOwner ~= SANDORIA) then - player:showText(npc,ATTARENA_CLOSED_DIALOG); - else - player:showText(npc,ATTARENA_OPEN_DIALOG); - - stock = {0x026f,119, -- Bay Leaves - 0x103a,6440} -- Holy Water - - showShop(player,SANDORIA,stock); - end -end; + if (RegionOwner ~= SANDORIA) then + player:showText(npc,ATTARENA_CLOSED_DIALOG); + else + player:showText(npc,ATTARENA_OPEN_DIALOG); + + stock = {0x026f,119, -- Bay Leaves + 0x103a,6440} -- Holy Water + + showShop(player,SANDORIA,stock); + end +end; ----------------------------------- -- onEventUpdate @@ -67,5 +66,3 @@ --printf("RESULT: %u",option); end; - - Index: scripts/zones/Northern_San_dOria/npcs/Vichuel.lua =================================================================== --- scripts/zones/Northern_San_dOria/npcs/Vichuel.lua (revision 3302) +++ scripts/zones/Northern_San_dOria/npcs/Vichuel.lua (working copy) @@ -1,11 +1,12 @@ ----------------------------------- --- Area: Northern San d'Oria --- NPC: Vichuel --- Only sells when San d'Oria controlls Fauregandi Region +-- Area: Northern San d'Oria +-- NPC: Vichuel +-- Only sells when San d'Oria controlls Fauregandi Region ----------------------------------- package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -17,15 +18,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -37,18 +36,18 @@ RegionOwner = GetRegionOwner(FAUREGANDI); -if (RegionOwner ~= SANDORIA) then - player:showText(npc,VICHUEL_CLOSED_DIALOG); +if (RegionOwner ~= SANDORIA) then + player:showText(npc,VICHUEL_CLOSED_DIALOG); else - player:showText(npc,VICHUEL_OPEN_DIALOG); - - stock = {0x11db,90, -- Beaugreens - 0x110b,39, -- Faerie Apple - 0x02b3,54} -- Maple Log - + player:showText(npc,VICHUEL_OPEN_DIALOG); + + stock = {0x11db,90, -- Beaugreens + 0x110b,39, -- Faerie Apple + 0x02b3,54} -- Maple Log + showShop(player,SANDORIA,stock); end -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Southern_San_dOria/npcs/Apairemant.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Apairemant.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/npcs/Apairemant.lua (working copy) @@ -1,13 +1,14 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Apairemant --- Only sells when San d'Oria controls Gustaberg Region --- @zone 230 --- @pos 72 2 0 +-- Area: Southern San d'Oria +-- NPC: Apairemant +-- Only sells when San d'Oria controls Gustaberg Region +-- @zone 230 +-- @pos 72 2 0 ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -19,15 +20,14 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then - player:messageSpecial(FLYER_REFUSED); + + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then + player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -38,20 +38,20 @@ function onTrigger(player,npc) RegionOwner = GetRegionOwner(GUSTABERG); - if (RegionOwner ~= SANDORIA) then - player:showText(npc,APAIREMANT_CLOSED_DIALOG); + if (RegionOwner ~= SANDORIA) then + player:showText(npc,APAIREMANT_CLOSED_DIALOG); else - player:showText(npc,APAIREMANT_OPEN_DIALOG); - - stock = {0x0454,703, -- Sulfur - 0x026b,43, -- Popoto - 0x0263,36, -- Rye Flour - 0x1124,40} -- Eggplant - - showShop(player,SANDORIA,stock); + player:showText(npc,APAIREMANT_OPEN_DIALOG); + + stock = {0x0454,703, -- Sulfur + 0x026b,43, -- Popoto + 0x0263,36, -- Rye Flour + 0x1124,40} -- Eggplant + + showShop(player,SANDORIA,stock); end -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Southern_San_dOria/npcs/Corua.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Corua.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/npcs/Corua.lua (working copy) @@ -1,13 +1,14 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Corua --- Only sells when San d'Oria controlls Ronfaure Region --- @ zone 230 --- @pos -66 2 -11 +-- Area: Southern San d'Oria +-- NPC: Corua +-- Only sells when San d'Oria controlls Ronfaure Region +-- @ zone 230 +-- @pos -66 2 -11 ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -19,15 +20,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -37,22 +36,22 @@ function onTrigger(player,npc) - RegionOwner = GetRegionOwner(RONFAURE); + RegionOwner = GetRegionOwner(RONFAURE); -- player:startEvent(0x0351) - are you the chicks owner - if (RegionOwner ~= SANDORIA) then - player:showText(npc,CORUA_CLOSED_DIALOG); - else - player:showText(npc,CORUA_OPEN_DIALOG); - - stock = {0x1125,29, -- San d'Orian Carrot - 0x114f,69, -- San d'Orian Grape - 0x027f,110, -- Chestnut - 0x0262,55} -- San d'Orian Flour - - showShop(player,SANDORIA,stock); - end + if (RegionOwner ~= SANDORIA) then + player:showText(npc,CORUA_CLOSED_DIALOG); + else + player:showText(npc,CORUA_OPEN_DIALOG); + + stock = {0x1125,29, -- San d'Orian Carrot + 0x114f,69, -- San d'Orian Grape + 0x027f,110, -- Chestnut + 0x0262,55} -- San d'Orian Flour + + showShop(player,SANDORIA,stock); + end -end; +end; ----------------------------------- -- onEventUpdate @@ -74,4 +73,3 @@ - Index: scripts/zones/Southern_San_dOria/npcs/Machielle.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Machielle.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/npcs/Machielle.lua (working copy) @@ -1,11 +1,12 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Machielle --- Only sells when Bastok controls Norvallen Region +-- Area: Southern San d'Oria +-- NPC: Machielle +-- Only sells when Bastok controls Norvallen Region ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -17,15 +18,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -37,19 +36,19 @@ RegionOwner = GetRegionOwner(NORVALLEN); -if (RegionOwner ~= SANDORIA) then - player:showText(npc,MACHIELLE_CLOSED_DIALOG); +if (RegionOwner ~= SANDORIA) then + player:showText(npc,MACHIELLE_CLOSED_DIALOG); else - player:showText(npc,MACHIELLE_OPEN_DIALOG); - - stock = {0x02b0,18, --Arrowwood Log - 0x026d,25, --Crying Mustard - 0x026a,25, --Blue Peas - 0x02ba,88} --Ash Log - + player:showText(npc,MACHIELLE_OPEN_DIALOG); + + stock = {0x02b0,18, --Arrowwood Log + 0x026d,25, --Crying Mustard + 0x026a,25, --Blue Peas + 0x02ba,88} --Ash Log + showShop(player,SANDORIA,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -70,5 +69,3 @@ end; - - Index: scripts/zones/Southern_San_dOria/npcs/Phamelise.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Phamelise.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/npcs/Phamelise.lua (working copy) @@ -1,11 +1,12 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Phamelise --- Only sells when San d'Oria controlls Zulkheim Region +-- Area: Southern San d'Oria +-- NPC: Phamelise +-- Only sells when San d'Oria controlls Zulkheim Region ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -17,15 +18,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then - player:messageSpecial(FLYER_REFUSED); + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount(); == 1) then + player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -37,23 +36,23 @@ RegionOwner = GetRegionOwner(ZULKHEIM); - if (RegionOwner ~= SANDORIA) then + if (RegionOwner ~= SANDORIA) then player:showText(npc,PHAMELISE_CLOSED_DIALOG); else player:showText(npc,PHAMELISE_OPEN_DIALOG); - - stock = {0x1114,44, --Giant Sheep Meat - 0x026e,44, --Dried Marjoram - 0x0262,55, --San d'Orian Flour - 0x0263,36, --Rye Flour - 0x0730,1840, --Semolina - 0x110e,22, --La Theine Cabbage - 0x111a,55} --Selbina Milk + + stock = {0x1114,44, --Giant Sheep Meat + 0x026e,44, --Dried Marjoram + 0x0262,55, --San d'Orian Flour + 0x0263,36, --Rye Flour + 0x0730,1840, --Semolina + 0x110e,22, --La Theine Cabbage + 0x111a,55} --Selbina Milk showShop(player,SANDORIA,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -74,5 +73,3 @@ end; - - Index: scripts/zones/Southern_San_dOria/npcs/Pourette.lua =================================================================== --- scripts/zones/Southern_San_dOria/npcs/Pourette.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/npcs/Pourette.lua (working copy) @@ -1,11 +1,12 @@ ----------------------------------- --- Area: Southern San d'Oria --- NPC: Pourette --- Only sells when San d'Oria controlls Derfland Region +-- Area: Southern San d'Oria +-- NPC: Pourette +-- Only sells when San d'Oria controlls Derfland Region ----------------------------------- package.loaded["scripts/zones/Southern_San_dOria/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals"); require("scripts/globals/settings"); require("scripts/globals/shop"); require("scripts/globals/quests"); @@ -17,15 +18,13 @@ ----------------------------------- function onTrade(player,npc,trade) --- "Flyers for Regine" conditional script -FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE); - - if (FlyerForRegine == 1) then - count = trade:getItemCount(); - MagicFlyer = trade:hasItemQty(532,1); - if (MagicFlyer == true and count == 1) then + -- "Flyers for Regine" conditional script + if (player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE) == 1) then + if (trade:hasItemQty(532,1) == true and trade:getItemCount() == 1) then player:messageSpecial(FLYER_REFUSED); end + else + onHalloweenTrade(player,trade,npc); end end; @@ -35,24 +34,24 @@ function onTrigger(player,npc) - RegionOwner = GetRegionOwner(DERFLAND); + RegionOwner = GetRegionOwner(DERFLAND); - if (RegionOwner ~= SANDORIA) then - player:showText(npc,POURETTE_CLOSED_DIALOG); - else - player:showText(npc,POURETTE_OPEN_DIALOG); - - stock = {0x1100,128, --Derfland Pear - 0x0269,142, --Ginger - 0x11c1,62, --Gysahl Greens - 0x0584,1656, --Olive Flower - 0x0279,14, --Olive Oil - 0x03b7,110} --Wijnruit + if (RegionOwner ~= SANDORIA) then + player:showText(npc,POURETTE_CLOSED_DIALOG); + else + player:showText(npc,POURETTE_OPEN_DIALOG); + + stock = {0x1100,128, --Derfland Pear + 0x0269,142, --Ginger + 0x11c1,62, --Gysahl Greens + 0x0584,1656, --Olive Flower + 0x0279,14, --Olive Oil + 0x03b7,110} --Wijnruit - showShop(player,SANDORIA,stock); - end + showShop(player,SANDORIA,stock); + end -end; +end; ----------------------------------- -- onEventUpdate @@ -73,5 +72,3 @@ end; - - Index: scripts/zones/Southern_San_dOria/Zone.lua =================================================================== --- scripts/zones/Southern_San_dOria/Zone.lua (revision 3302) +++ scripts/zones/Southern_San_dOria/Zone.lua (working copy) @@ -14,6 +14,7 @@ ----------------------------------- function onInitialize(zone) + --zone:registerRegion(1,-96,-7,121,-64,-5,137); -- Harvest Festival end; ----------------------------------- @@ -46,6 +47,14 @@ ----------------------------------- function onRegionEnter(player,region) + switch (region:GetRegionID()): caseof + { + [1] = function (x) -- Check for Ghost and Skeleton + if(player:getVar("gotitallCS") == 5)then + player:startEvent(0x020e); + end + end, + } end; ----------------------------------- Index: scripts/zones/Windurst_Waters/npcs/Ahyeekih.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Ahyeekih.lua (revision 3302) +++ scripts/zones/Windurst_Waters/npcs/Ahyeekih.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Windurst Waters --- NPC: Ahyeekih --- Only sells when Windurst controls Kolshushu --- Working 100% +-- Area: Windurst Waters +-- NPC: Ahyeekih +-- Only sells when Windurst controls Kolshushu +-- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -25,20 +27,20 @@ RegionOwner = GetRegionOwner(KOLSHUSHU); -if (RegionOwner ~= WINDURST) then - player:showText(npc,AHYEEKIH_CLOSED_DIALOG); +if (RegionOwner ~= WINDURST) then + player:showText(npc,AHYEEKIH_CLOSED_DIALOG); else - player:showText(npc,AHYEEKIH_OPEN_DIALOG); - - stock = {0x1197,184, --Buburimu Grape - 0x0460,1620, --Casablanca - 0x1107,220, --Dhalmel Meat - 0x0266,72, --Mhaura Garlic - 0x115d,40} --Yagudo Cherry + player:showText(npc,AHYEEKIH_OPEN_DIALOG); + + stock = {0x1197,184, --Buburimu Grape + 0x0460,1620, --Casablanca + 0x1107,220, --Dhalmel Meat + 0x0266,72, --Mhaura Garlic + 0x115d,40} --Yagudo Cherry showShop(player,WINDURST,stock); end -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Windurst_Waters/npcs/Ensasa.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Ensasa.lua (revision 3302) +++ scripts/zones/Windurst_Waters/npcs/Ensasa.lua (working copy) @@ -5,6 +5,7 @@ -- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; require("scripts/zones/Windurst_Waters/TextIDs"); @@ -14,35 +15,36 @@ ----------------------------------- function onTrade(player,npc,trade) -end; + onHalloweenTrade(player,trade,npc); +end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) - + player:showText(npc,ENSASA_SHOP_DIALOG); stock = {0x0068,3881,1, --Tarutaru Folding Screen - 0x43b8,5,2, --Crossbow Bolt - 0x43a6,3,2, --Wooden Arrow - 0x0070,456,2, --Yellow Jar + 0x43b8,5,2, --Crossbow Bolt + 0x43a6,3,2, --Wooden Arrow + 0x0070,456,2, --Yellow Jar - 0x43a7,4,3, --Bone Arrow - 0x00da,920,3, --Earthen Flowerpot - 0x43f4,3,3, --Little Worm - 0x43f3,9,3, --Lugworm - 0x0762,576,3, --River Foliage - 0x13c9,283,3, --Earth Threnody - 0x13c6,644,3, --Fire Threnody - 0x0763,576,3, --Sea Foliage - 0x005c,905,3, --Tarutaru Stool - 0x006e,4744,3} --White Jar + 0x43a7,4,3, --Bone Arrow + 0x00da,920,3, --Earthen Flowerpot + 0x43f4,3,3, --Little Worm + 0x43f3,9,3, --Lugworm + 0x0762,576,3, --River Foliage + 0x13c9,283,3, --Earth Threnody + 0x13c6,644,3, --Fire Threnody + 0x0763,576,3, --Sea Foliage + 0x005c,905,3, --Tarutaru Stool + 0x006e,4744,3} --White Jar showNationShop(player, WINDURST, stock); -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Windurst_Waters/npcs/Maqu_Molpih.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Maqu_Molpih.lua (revision 3302) +++ scripts/zones/Windurst_Waters/npcs/Maqu_Molpih.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Windurst Waters --- NPC: Maqu Molpih --- Only sells when Windurst controlls Aragoneu Region --- Working 100% +-- Area: Windurst Waters +-- NPC: Maqu Molpih +-- Only sells when Windurst controlls Aragoneu Region +-- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -25,20 +27,20 @@ RegionOwner = GetRegionOwner(ARAGONEU); -if (RegionOwner ~= WINDURST) then - player:showText(npc,MAQUMOLPIH_CLOSED_DIALOG); +if (RegionOwner ~= WINDURST) then + player:showText(npc,MAQUMOLPIH_CLOSED_DIALOG); else - player:showText(npc,MAQUMOLPIH_OPEN_DIALOG); - - stock = {0x0277,36, --Horo Flour - 0x0275,44, --Millioncorn - 0x113f,114, --Roasted Corn - 0x1199,92, --Sunflower Seeds - 0x0349,36} --Yagudo Feather - + player:showText(npc,MAQUMOLPIH_OPEN_DIALOG); + + stock = {0x0277,36, --Horo Flour + 0x0275,44, --Millioncorn + 0x113f,114, --Roasted Corn + 0x1199,92, --Sunflower Seeds + 0x0349,36} --Yagudo Feather + showShop(player,WINDURST,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -57,6 +59,3 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; - - - Index: scripts/zones/Windurst_Waters/npcs/Ness_Rugetomal.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Ness_Rugetomal.lua (revision 3302) +++ scripts/zones/Windurst_Waters/npcs/Ness_Rugetomal.lua (working copy) @@ -5,6 +5,7 @@ -- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; require("scripts/zones/Windurst_Waters/TextIDs"); @@ -14,32 +15,33 @@ ----------------------------------- function onTrade(player,npc,trade) -end; + onHalloweenTrade(player,trade,npc); +end; ----------------------------------- -- onTrigger Action ----------------------------------- function onTrigger(player,npc) - + player:showText(npc,NESSRUGETOMALL_SHOP_DIALOG); -stock = {0x112a,10,1, --Ginger Cookie - 0x1137,727,1, --Carp Sushi - 0x1149,323,1, --Tomato Juice - 0x116b,1656,1, --Nebimonite Bake +stock = {0x112a,10,1, --Ginger Cookie + 0x1137,727,1, --Carp Sushi + 0x1149,323,1, --Tomato Juice + 0x116b,1656,1, --Nebimonite Bake - 0x112d,14,2, --Cinna-cookie - 0x1146,184,2, --Orange Juice - 0x1168,2070,2, --Boiled Crab + 0x112d,14,2, --Cinna-cookie + 0x1146,184,2, --Orange Juice + 0x1168,2070,2, --Boiled Crab - 0x119e,21,3, --Acorn Cookie - 0x1118,108,3, --Meat Jerky - 0x119d,10,3, --Distilled Water - 0x11ba,846} --Roast Pipira + 0x119e,21,3, --Acorn Cookie + 0x1118,108,3, --Meat Jerky + 0x119d,10,3, --Distilled Water + 0x11ba,846} --Roast Pipira showNationShop(player, WINDURST, stock); -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Windurst_Waters/npcs/Upih_Khachla.lua =================================================================== --- scripts/zones/Windurst_Waters/npcs/Upih_Khachla.lua (revision 3302) +++ scripts/zones/Windurst_Waters/npcs/Upih_Khachla.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Windurst Waters --- NPC: Upih Khachla --- Standard Merchant NPC --- Working 100% +-- Area: Windurst Waters +-- NPC: Upih Khachla +-- Standard Merchant NPC +-- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Windurst_Waters/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -22,41 +24,41 @@ ----------------------------------- function onTrigger(player,npc) - + player:showText(npc,UPIHKHACHLA_SHOP_DIALOG); -stock = {0x43a1,1107,1, --Grenade - 0x1010,837,1, --Potion - 0x3b7,108,1, --Wijnruit +stock = {0x43a1,1107,1, --Grenade + 0x1010,837,1, --Potion + 0x3b7,108,1, --Wijnruit - 0x27c,119,2, --Chamomile - 0x1037,736,2, --Echo Drops - 0x1020,4445,2, --Ether + 0x27c,119,2, --Chamomile + 0x1037,736,2, --Echo Drops + 0x1020,4445,2, --Ether - 0x1034,290,3, --Antidote - 0x764,3960,3, --Desalinator - 0x26e,44,3, --Dried Marjoram - 0x1036,2387,3, --Eye Drops - 0x25d,180,3, --Pickaxe - 0x765,3960,3, --Salinator - 0x3fc,276,3, --Sickle - 0x4d9,354,3} --Twinkle Powder - + 0x1034,290,3, --Antidote + 0x764,3960,3, --Desalinator + 0x26e,44,3, --Dried Marjoram + 0x1036,2387,3, --Eye Drops + 0x25d,180,3, --Pickaxe + 0x765,3960,3, --Salinator + 0x3fc,276,3, --Sickle + 0x4d9,354,3} --Twinkle Powder + rank = getNationRank(WINDURST); - if (rank ~= 1) then - table.insert(stock,0x03fe); --Thief's Tools - table.insert(stock,3643); - table.insert(stock,3); - end - if (rank == 3) then - table.insert(stock,0x03ff); --Living Key - table.insert(stock,5520); - table.insert(stock,3); - end + if (rank ~= 1) then + table.insert(stock,0x03fe); --Thief's Tools + table.insert(stock,3643); + table.insert(stock,3); + end + if (rank == 3) then + table.insert(stock,0x03ff); --Living Key + table.insert(stock,5520); + table.insert(stock,3); + end showNationShop(player, WINDURST, stock); -end; +end; ----------------------------------- -- onEventUpdate @@ -75,6 +77,3 @@ --printf("CSID: %u",csid); --printf("RESULT: %u",option); end; - - - Index: scripts/zones/Windurst_Woods/npcs/Kuzah_Hpirohpon.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Kuzah_Hpirohpon.lua (revision 3302) +++ scripts/zones/Windurst_Woods/npcs/Kuzah_Hpirohpon.lua (working copy) @@ -1,47 +1,49 @@ ------------------------------------ --- Area: Windurst Woods --- NPC: Kuzah Hpirohpon --- Guild Merchant NPC: Clothcrafting Guild --- @zone: 241 --- @pos: -80.068 -3.25 -127.686 ------------------------------------ -package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; ------------------------------------ -require("scripts/globals/settings"); -require("scripts/zones/Windurst_Woods/TextIDs"); - ------------------------------------ --- onTrade Action ------------------------------------ - -function onTrade(player,npc,trade) -end; - ------------------------------------ --- onTrigger Action ------------------------------------ - -function onTrigger(player,npc) - if(player:sendGuild(515,6,21,1)) then - player:showText(npc,KUZAH_HPIROHPON_DIALOG); - end -end; - ------------------------------------ --- onEventUpdate ------------------------------------ - -function onEventUpdate(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - ------------------------------------ --- onEventFinish ------------------------------------ - -function onEventFinish(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - +----------------------------------- +-- Area: Windurst Woods +-- NPC: Kuzah Hpirohpon +-- Guild Merchant NPC: Clothcrafting Guild +-- @zone: 241 +-- @pos: -80.068 -3.25 -127.686 +----------------------------------- +package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/harvest_festivals"); +require("scripts/globals/settings"); +require("scripts/zones/Windurst_Woods/TextIDs"); + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + if(player:sendGuild(515,6,21,1)) then + player:showText(npc,KUZAH_HPIROHPON_DIALOG); + end +end; + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; + +----------------------------------- +-- onEventFinish +----------------------------------- + +function onEventFinish(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; Index: scripts/zones/Windurst_Woods/npcs/Meriri.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Meriri.lua (revision 3302) +++ scripts/zones/Windurst_Woods/npcs/Meriri.lua (working copy) @@ -1,47 +1,50 @@ ------------------------------------ --- Area: Windurst Woods --- NPC: Meriri --- Guild Merchant NPC: Clothcrafting Guild --- @zone: 241 --- @pos: -76.471 -3.55 -128.341 ------------------------------------ -package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; ------------------------------------ -require("scripts/globals/settings"); -require("scripts/zones/Windurst_Woods/TextIDs"); - ------------------------------------ --- onTrade Action ------------------------------------ - -function onTrade(player,npc,trade) -end; - ------------------------------------ --- onTrigger Action ------------------------------------ - -function onTrigger(player,npc) - if(player:sendGuild(515,6,21,1)) then - player:showText(npc,MERIRI_DIALOG); - end -end; - ------------------------------------ --- onEventUpdate ------------------------------------ - -function onEventUpdate(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - ------------------------------------ --- onEventFinish ------------------------------------ - -function onEventFinish(player,csid,option) - -- printf("CSID: %u",csid); - -- printf("RESULT: %u",option); -end; - +----------------------------------- +-- Area: Windurst Woods +-- NPC: Meriri +-- Guild Merchant NPC: Clothcrafting Guild +-- @zone: 241 +-- @pos: -76.471 -3.55 -128.341 +----------------------------------- +package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; +----------------------------------- + +require("scripts/globals/harvest_festivals") +require("scripts/globals/settings"); +require("scripts/zones/Windurst_Woods/TextIDs"); + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) + if(player:sendGuild(515,6,21,1)) then + player:showText(npc,MERIRI_DIALOG); + end +end; + +----------------------------------- +-- onEventUpdate +----------------------------------- + +function onEventUpdate(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; + +----------------------------------- +-- onEventFinish +----------------------------------- + +function onEventFinish(player,csid,option) + -- printf("CSID: %u",csid); + -- printf("RESULT: %u",option); +end; + Index: scripts/zones/Windurst_Woods/npcs/Millerovieunet.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Millerovieunet.lua (revision 3302) +++ scripts/zones/Windurst_Woods/npcs/Millerovieunet.lua (working copy) @@ -1,12 +1,13 @@ ----------------------------------- --- Area: Windurst_Woods --- NPC: Millerovieunet --- Only sells when Windurst controlls Qufim Region --- Working 100% +-- Area: Windurst_Woods +-- NPC: Millerovieunet +-- Only sells when Windurst controlls Qufim Region +-- Working 100% ----------------------------------- package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); require("scripts/zones/Windurst_Woods/TextIDs"); @@ -16,6 +17,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -24,17 +26,17 @@ function onTrigger(player,npc) - if(GetRegionOwner(QUFIMISLAND) ~= WINDURST) then - player:showText(npc,MILLEROVIEUNET_CLOSED_DIALOG); - else - player:showText(npc,MILLEROVIEUNET_OPEN_DIALOG); - - stock = {0x03ba,4121} --Magic Pot Shard - - showShop(player,WINDURST,stock); - end + if(GetRegionOwner(QUFIMISLAND) ~= WINDURST) then + player:showText(npc,MILLEROVIEUNET_CLOSED_DIALOG); + else + player:showText(npc,MILLEROVIEUNET_OPEN_DIALOG); + + stock = {0x03ba,4121} --Magic Pot Shard + + showShop(player,WINDURST,stock); + end -end; +end; ----------------------------------- -- onEventUpdate @@ -52,4 +54,5 @@ function onEventFinish(player,csid,option) --printf("CSID: %u",csid); --printf("RESULT: %u",option); -end; \ No newline at end of file +end; + Index: scripts/zones/Windurst_Woods/npcs/Nhobi_Zalkia.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Nhobi_Zalkia.lua (revision 3302) +++ scripts/zones/Windurst_Woods/npcs/Nhobi_Zalkia.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Windurst_Woods --- NPC: Nhobi Zalkia --- Only sells when Windurst controlls Kuzotz Region --- Working 100% +-- Area: Windurst_Woods +-- NPC: Nhobi Zalkia +-- Only sells when Windurst controlls Kuzotz Region +-- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -25,18 +27,18 @@ RegionOwner = GetRegionOwner(KUZOTZ); -if (RegionOwner ~= WINDURST) then - player:showText(npc,NHOBI_ZALKIA_CLOSED_DIALOG); +if (RegionOwner ~= WINDURST) then + player:showText(npc,NHOBI_ZALKIA_CLOSED_DIALOG); else - player:showText(npc,NHOBI_ZALKIA_OPEN_DIALOG); - - stock = {0x0394,855, --Cactuar Needle - 0x113c,299, --Thundermelon - 0x118b,184} --Watermelon + player:showText(npc,NHOBI_ZALKIA_OPEN_DIALOG); + + stock = {0x0394,855, --Cactuar Needle + 0x113c,299, --Thundermelon + 0x118b,184} --Watermelon showShop(player,WINDURST,stock); end -end; +end; ----------------------------------- -- onEventUpdate Index: scripts/zones/Windurst_Woods/npcs/Taraihi-Perunhi.lua =================================================================== --- scripts/zones/Windurst_Woods/npcs/Taraihi-Perunhi.lua (revision 3302) +++ scripts/zones/Windurst_Woods/npcs/Taraihi-Perunhi.lua (working copy) @@ -1,10 +1,11 @@ ----------------------------------- --- Area: Windurst Woods --- NPC: Taraihi-Perunhi --- Only sells when Windurst controlls Derfland Region --- Working 100% +-- Area: Windurst Woods +-- NPC: Taraihi-Perunhi +-- Only sells when Windurst controlls Derfland Region +-- Working 100% ----------------------------------- +require("scripts/globals/harvest_festivals") require("scripts/globals/shop"); require("scripts/globals/conquest"); package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil; @@ -15,6 +16,7 @@ ----------------------------------- function onTrade(player,npc,trade) + onHalloweenTrade(player,trade,npc); end; ----------------------------------- @@ -25,21 +27,21 @@ RegionOwner = GetRegionOwner(DERFLAND); -if (RegionOwner ~= WINDURST) then - player:showText(npc,TARAIHIPERUNHI_CLOSED_DIALOG); +if (RegionOwner ~= WINDURST) then + player:showText(npc,TARAIHIPERUNHI_CLOSED_DIALOG); else - player:showText(npc,TARAIHIPERUNHI_OPEN_DIALOG); - - stock = {0x1100,128, --Derfland Pear - 0x0269,142, --Ginger - 0x11c1,62, --Gysahl Greens - 0x0584,1656, --Olive Flower - 0x0279,14, --Olive Oil - 0x03b7,110} --Wijnruit + player:showText(npc,TARAIHIPERUNHI_OPEN_DIALOG); + + stock = {0x1100,128, --Derfland Pear + 0x0269,142, --Ginger + 0x11c1,62, --Gysahl Greens + 0x0584,1656, --Olive Flower + 0x0279,14, --Olive Oil + 0x03b7,110} --Wijnruit showShop(player,WINDURST,stock); end -end; +end; ----------------------------------- -- onEventUpdate @@ -60,4 +62,3 @@ end; - Index: sql/mob_change_skin.sql =================================================================== --- sql/mob_change_skin.sql (revision 3304) +++ sql/mob_change_skin.sql (working copy) @@ -67,4 +67,28 @@ INSERT INTO mob_change_skin VALUES ('36', 'Ice_Elemental', 0x0000B50100000000000000000000000000000000, '0'); INSERT INTO mob_change_skin VALUES ('37', 'Lightning_Elemental', 0x0000B90100000000000000000000000000000000, '0'); INSERT INTO mob_change_skin VALUES ('38', 'Light_Elemental', 0x0000BA0100000000000000000000000000000000, '0'); -INSERT INTO mob_change_skin VALUES ('39', 'Dark_Elemental', 0x0000BB0100000000000000000000000000000000, '0'); \ No newline at end of file +INSERT INTO mob_change_skin VALUES ('39', 'Dark_Elemental', 0x0000BB0100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('40', 'Proud_Beard', 0x0000170200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('41', 'Faustin', 0x00006D0100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('42', 'Aulavia', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('43', 'Mille', 0x0000840200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('44', 'Emaliveulaux', 0x0000340200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('45', 'Olwyn', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('46', 'Apairemant', 0x0000130200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('47', 'Machielle', 0x0000440200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('48', 'Phamelise', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('49', 'Pourette', 0x0000640200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('50', 'Corua', 0x0000340200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('51', 'Attarena', 0x0000640200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('52', 'Antonian', 0x00006D0100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('53', 'Vichuel', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('54', 'Kuzah_Hpirohpon', 0x0000440200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('55', 'Meriri', 0x0000840200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('56', 'Nhobi_Zalkia', 0x0000170200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('57', 'Millerovieunet', 0x0000640200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('58', 'Taraihi-Perunhi', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('59', 'Ness_Rugetomal', 0x00006D0100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('60', 'Upih_Khachla', 0x0000700100000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('61', 'Ensasa', 0x0000340200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('62', 'Ahyeekih', 0x0000170200000000000000000000000000000000, '0'); +INSERT INTO mob_change_skin VALUES ('63', 'Maqu_Molpih', 0x0000640200000000000000000000000000000000, '0'); Index: src/map/lua/lua_baseentity.cpp =================================================================== --- src/map/lua/lua_baseentity.cpp (revision 3302) +++ src/map/lua/lua_baseentity.cpp (working copy) @@ -4980,7 +4980,7 @@ { DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL); DSP_DEBUG_BREAK_IF(lua_isnil(L,1) || !lua_isnumber(L,1)); - DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_MOB); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_MOB); CMobEntity* PMob = (CMobEntity*)m_PBaseEntity;