Beadeaux "The Mute" and "The Afflictor" Fix

Post Reply
santssoft
Posts: 40
Joined: Tue Apr 30, 2013 5:41 am

Beadeaux "The Mute" and "The Afflictor" Fix

Post by santssoft » Sun Jun 16, 2013 8:47 am

Fix call of luautils::OnEffectGain in status_effect_container.cpp to add modifiers before the apply of modifiers on PC

The Afflictor:
  • When you are at a distance less than 10 CURSED state apply unless you have the status effect CURSED or SILENCED
  • TODO: animation when you pass next to The Afflictor and you gain the CURSED status effect
The Mute:
  • silenced status effect time is now between 10-15 minutes (ffxiclopedia)
  • TODO: animation when you touch the The Muteand you gain the SILENCED status effect
Attachments
TheAfflictor-TheMute fix_V3.patch
(8.67 KiB) Downloaded 189 times
Last edited by santssoft on Mon Jun 17, 2013 8:39 am, edited 4 times in total.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Beadeaux "The Mute" and "The Afflictor" Fix

Post by bluekirby0 » Sun Jun 16, 2013 11:58 am

Good concept, but the performance impact is pretty large for a function that will rarely get used. It would be a better idea to use the new circular region declarations in the zone's script and script these OnRegionEnter since the NPCs themselves don't move.

santssoft
Posts: 40
Joined: Tue Apr 30, 2013 5:41 am

Re: Beadeaux "The Mute" and "The Afflictor" Fix

Post by santssoft » Sun Jun 16, 2013 1:21 pm

Thanks for the information about circular regions, bluekirby0. I updated the path to use this regions and delete the OnRangePC function.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Beadeaux "The Mute" and "The Afflictor" Fix

Post by bluekirby0 » Mon Jun 17, 2013 2:38 am

Much better! I'm not set up to test right now, so I'll give you a couple more easy fixes and try to look back into this later if someone doesn't beat me to it.

First off, define regions starting with 1 using contiguous numbers. The parser is kinda picky about skipping numbers, plus it will help with the next thing.

Code: Select all

        -- 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;
Even though you are the only one defining regions so far in that zone, its best to filter any region logic by the region number.

Code: Select all

function onRegionEnter(player,region)
	if(region <= 6)
		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;

santssoft
Posts: 40
Joined: Tue Apr 30, 2013 5:41 am

Re: Beadeaux "The Mute" and "The Afflictor" Fix

Post by santssoft » Mon Jun 17, 2013 3:20 am

Thanks bluekirby0, I will fix it.

santssoft
Posts: 40
Joined: Tue Apr 30, 2013 5:41 am

Re: Beadeaux "The Mute" and "The Afflictor" Fix

Post by santssoft » Mon Jun 17, 2013 5:34 am

Fix TYPO in "if (region <= 6) then", correct "if (region:GetRegionID() <= 6) then"

Post Reply