Index: scripts/zones/Beadeaux/npcs/The_Afflictor.lua =================================================================== --- scripts/zones/Beadeaux/npcs/The_Afflictor.lua (revision 3530) +++ scripts/zones/Beadeaux/npcs/The_Afflictor.lua (working copy) @@ -1,8 +1,8 @@ ----------------------------------- -- Area: Beadeaux --- NPC: ??? +-- NPC: The Afflictor -- @zone 147 --- @pos -160, -145, 1 +-- @pos ----------------------------------- package.loaded["scripts/zones/Beadeaux/TextIDs"] = nil; ----------------------------------- @@ -23,15 +23,11 @@ ----------------------------------- function onTrigger(player,npc) - if(player:getQuestStatus(BASTOK,THE_CURSE_COLLECTOR) == QUEST_ACCEPTED and player:getVar("cCollectCurse") == 0) then player:setVar("cCollectCurse",1); end - if (player:hasStatusEffect(EFFECT_CURSE_I) == false) then - player:addStatusEffect(EFFECT_CURSE_I,0,0,300); - end +end; -end; ----------------------------------- -- onEventUpdate ----------------------------------- Index: scripts/zones/Beadeaux/npcs/The_Mute.lua =================================================================== --- scripts/zones/Beadeaux/npcs/The_Mute.lua (revision 3530) +++ scripts/zones/Beadeaux/npcs/The_Mute.lua (working copy) @@ -1,8 +1,8 @@ ----------------------------------- -- Area: Beadeaux --- NPC: ??? +-- NPC: The Mute -- @zone 147 --- @pos -166.230 -1 -73.685 +-- @pos ----------------------------------- package.loaded["scripts/zones/Beadeaux/TextIDs"] = nil; ----------------------------------- @@ -22,12 +22,13 @@ ----------------------------------- function onTrigger(player,npc) + local duration = math.random(600,900); if(player:getQuestStatus(BASTOK,THE_CURSE_COLLECTOR) == QUEST_ACCEPTED and player:getVar("cCollectSilence") == 0) then player:setVar("cCollectSilence",1); end if(player:hasStatusEffect(EFFECT_SILENCE) == false) then - player:addStatusEffect(EFFECT_SILENCE,0,0,300); + player:addStatusEffect(EFFECT_SILENCE,0,0,duration); end end; Index: scripts/zones/Beadeaux/npcs/Treasure_Coffer.lua =================================================================== --- scripts/zones/Beadeaux/npcs/Treasure_Coffer.lua (revision 3530) +++ scripts/zones/Beadeaux/npcs/Treasure_Coffer.lua (working copy) @@ -23,14 +23,14 @@ function onTrade(player,npc,trade) - key = trade:hasItemQty(1043,1); -- Treasure Key - sk = trade:hasItemQty(1115,1); -- Skeleton Key - lk = trade:hasItemQty(1023,1); -- Living Key - ttk = trade:hasItemQty(1022,1); -- Thief's Tools - questItemNeeded = 0; + -- trade:hasItemQty(1043,1); -- Treasure Key + -- = trade:hasItemQty(1115,1); -- Skeleton Key + -- = trade:hasItemQty(1023,1); -- Living Key + -- = trade:hasItemQty(1022,1); -- Thief's Tools + local questItemNeeded = 0; -- Player traded a key. - if((key or sk or lk or ttk) and trade:getItemCount() == 1) then + if((trade:hasItemQty(1043,1) or trade:hasItemQty(1115,1) or trade:hasItemQty(1023,1) or trade:hasItemQty(1022,1)) and trade:getItemCount() == 1) then -- IMPORTANT ITEM: AF Keyitems, AF Items, & Map ----------- local mJob = player:getMainJob(); Index: scripts/zones/Beadeaux/Zone.lua =================================================================== --- scripts/zones/Beadeaux/Zone.lua (revision 3530) +++ scripts/zones/Beadeaux/Zone.lua (working copy) @@ -16,54 +16,70 @@ ----------------------------------- function onInitialize(zone) -end; + -- The Afflictor System (RegionID, X, Radius, Z) + zone:registerRegion(1, -163, 10, -137, 0,0,0); -- 17379798 The Afflictor + zone:registerRegion(2, -209, 10, -131, 0,0,0); -- 17379799 The Afflictor + zone:registerRegion(3, -140, 10, 20, 0,0,0); -- 17379800 The Afflictor + zone:registerRegion(4, 261, 10, 140, 0,0,0); -- 17379801 The Afflictor + zone:registerRegion(5, 340, 10, 100, 0,0,0); -- 17379802 The Afflictor + zone:registerRegion(6, 380, 10, 60, 0,0,0); -- 17379803 The Afflictor +end; ------------------------------------ --- onZoneIn ------------------------------------ +----------------------------------- +-- onZoneIn +----------------------------------- -function onZoneIn(player,prevZone) -cs = -1; - - if((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then - player:setPos(387.382,38.029,19.694,3); +function onZoneIn(player,prevZone) + local cs = -1; + + if((player:getXPos() == 0) and (player:getYPos() == 0) and (player:getZPos() == 0)) then + player:setPos(387.382,38.029,19.694,3); end - - if(prevZone == 109) then + + if(prevZone == 109) then if(player:getQuestStatus(BASTOK, BLADE_OF_DARKNESS) == QUEST_ACCEPTED and player:getVar("ChaosbringerKills") >= 100) then cs = 0x0079; elseif(player:getCurrentMission(BASTOK) == THE_FOUR_MUSKETEERS and player:getVar("MissionStatus") == 1) then cs = 0x0078; - elseif(player:getMainJob() == 8 and player:getQuestStatus(BASTOK,DARK_PUPPET) == QUEST_COMPLETED and player:getQuestStatus(BASTOK,BLADE_OF_EVIL) == QUEST_AVAILABLE) then + elseif(player:getMainJob() == 8 and player:getQuestStatus(BASTOK,DARK_PUPPET) == QUEST_COMPLETED and player:getQuestStatus(BASTOK,BLADE_OF_EVIL) == QUEST_AVAILABLE) then cs = 0x007a; end end - - return cs; - -end; ------------------------------------ --- onRegionEnter ------------------------------------ + return cs; +end; -function onRegionEnter(player,region) -end; +----------------------------------- +-- onRegionEnter +----------------------------------- ------------------------------------ --- onEventUpdate ------------------------------------ +function onRegionEnter(player,region) + if (region:GetRegionID() <= 6) then + if (player:hasStatusEffect(EFFECT_CURSE_I) == false and player:hasStatusEffect(EFFECT_SILENCE) == false) then + player:addStatusEffect(EFFECT_CURSE_I,50,0,300); + end + end +end; -function onEventUpdate(player,csid,option) --- printf("CSID: %u",csid); --- printf("RESULT: %u",option); -end; +----------------------------------- +-- OnRegionLeave +----------------------------------- ------------------------------------ --- onEventFinish ------------------------------------ +function onRegionLeave(player,region) +end; -function onEventFinish(player,csid,option) +----------------------------------- +-- 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); @@ -78,6 +94,5 @@ player:setPos(-297, 1, 96, 1); elseif(csid == 0x007a) then player:addQuest(BASTOK,BLADE_OF_EVIL); - end - -end; + end +end; Index: scripts/zones/Qulun_Dome/npcs/The_Mute.lua =================================================================== --- scripts/zones/Qulun_Dome/npcs/The_Mute.lua (revision 3530) +++ scripts/zones/Qulun_Dome/npcs/The_Mute.lua (working copy) @@ -1,8 +1,7 @@ ----------------------------------- --- Area: Beadeaux --- NPC: ??? --- @zone 147 --- @pos +-- Area: Qulun Dome +-- NPC: The Mute +-- @zone 148 ----------------------------------- package.loaded["scripts/zones/Beadeaux/TextIDs"] = nil; ----------------------------------- @@ -21,9 +20,10 @@ ----------------------------------- function onTrigger(player,npc) - - if(player:hasStatusEffect(EFFECT_MUTE) == false) then - player:addStatusEffect(EFFECT_MUTE,0,0,300,0,0); + local duration = math.random(600,900); + + if(player:hasStatusEffect(EFFECT_SILENCE) == false) then + player:addStatusEffect(EFFECT_SILENCE,0,0,duration); end end; Index: src/map/status_effect_container.cpp =================================================================== --- src/map/status_effect_container.cpp (revision 3530) +++ src/map/status_effect_container.cpp (working copy) @@ -326,6 +326,8 @@ PStatusEffect->SetStartTime(gettick()); + luautils::OnEffectGain(m_POwner, PStatusEffect); + m_POwner->addModifiers(&PStatusEffect->modList); if( m_POwner->health.maxhp != 0) //make sure we're not in the middle of logging in { @@ -334,8 +336,6 @@ m_StatusEffectList.push_back(PStatusEffect); - luautils::OnEffectGain(m_POwner, PStatusEffect); - if (m_POwner->objtype == TYPE_PC) { CCharEntity* PChar = (CCharEntity*)m_POwner;