Rough Scripts

Dancer
Post Reply
PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Rough Scripts

Post by PrBlahBlahtson » Sat Sep 01, 2012 3:58 pm

Long post ahead!

A collection of DNC scripts I wrote up. They don't address animations in the slightest. They're as close as I could get to retail without being able to log in and verify a few things, or there were minute details I never bothered to polish once I realized there was a little problem.

Yeah, the menu in the client will enforce recasts and TP costs, but using /ja commands kind of doesn't enforce either one right now. Little bit imbalanced. Can't be giving that to players.

Chocobo Jig:
Not sure if this used the generic quickening buff, or if it had its own. Doesn't mesh well with other quickening effects, though.

Code: Select all

function OnUseAbility(player, target, ability)

    -- Increases movement speed by 25% for 120s
	-- AF feet and Relic legs increase duration by 30s each
	local legs = player:getEquipID(7);
	local feet = player:getEquipID(8);
	local duration = 120;
	if(legs == 16360 or legs == 16361 or legs == 10728) then
		duration = duration + 30;
	end
	if(feet == 15746 or feet == 15747 or feet == 11393 or feet == 11394) then
		duration = duration + 30;
	end
	player:delStatusEffect(EFFECT_QUICKENING);
    player:addStatusEffect(EFFECT_QUICKENING,25,0,duration);
end;
Spectral Jig:

Code: Select all

function OnUseAbility(player, target, ability)

    -- Invisible and Sneak for approx 30-90s

	-- AF feet and Relic legs increase duration by 30s each
	legs = player:getEquipID(7);
	feet = player:getEquipID(8);
	duration = math.random(30, 90);
	if(legs == 16360 or legs == 16361 or legs == 10728) then
		duration = duration + 30;
	end
	if(feet == 15746 or feet == 15747 or feet == 11393 or feet == 11394) then
		duration = duration + 30;
	end
	player:addStatusEffect(EFFECT_SNEAK,0,10,math.floor(duration));
	player:addStatusEffect(EFFECT_INVISIBLE,0,10,math.floor(duration));
end;
Healing Waltz:
Erase didn't work when I wrote this, so the code never really got worked on. The notes might be of some use.
-- Spell: Healing Waltz
-- Can remove:
-- "Most effects Erase can"
-- Bane, Blind, Curse, Disease, Paralyze, Poison, Silence, Plague, Stat-down effects
-- Cannot remove:
-- Amnesia, Doom, Helix spells, Petrification, Gradual Petrification, Song effects, Stun, Mute, or Terror.
-- Source(s): http://wiki.ffxiclopedia.org/wiki/Healing_Waltz

The waltzes need "ability.lua" as they stand now, but this could be avoided by creating a Waltz Potency mod and checking it. They were based pretty heavily around how Cures are written now.

Code: Select all

function waltzPotency(player)

c = 0;
main = player:getEquipID(0);
sub = player:getEquipID(1);
range = player:getEquipID(2);
ammo = player:getEquipID(3);
head = player:getEquipID(4);
body = player:getEquipID(5);
hand = player:getEquipID(6);
leg = player:getEquipID(7);
foot = player:getEquipID(8);
neck = player:getEquipID(9);
waist = player:getEquipID(10);
ear1 = player:getEquipID(11);
ear2 = player:getEquipID(12);
ring1 = player:getEquipID(13);
ring2 = player:getEquipID(14);
back = player:getEquipID(15);

-- Sonia's Plectrum
-- Note: Campaign should add 10% instead of 1%.
if (ammo == 18735) then
	c = (c+0.01);
end
-- Roundel Earring
if (ear1 == 16002 or ear2 == 16002) then
	c = (c+0.05);
end
-- Etoile Tiara
if (head == 11478 or head == 11479) then
	c = (c+0.05);
end
-- Dancer's Casque
if (body == 14578 or body == 14579 or body == 11302 or body == 11303) then
	c = (c+0.10);
end

-- printf("Total enhancement: " .. (c+1));
return c;
 end;
Just saw today that potency caps at 30%, as well.

Waltzes:
Pretty much the same code, with different formulas. I'll put the formulas and caps below, just so this isn't enormous. Messages obviously aren't passed to other clients since they're handled in the LUA, so that's the biggest failure here. Range also isn't checked, but I think the database might handle that.

Code: Select all

function OnUseAbility(player, target, ability)
	hp = player:getHP();
	chr = player:getStat(MOD_CHR);
	vit = target:getStat(MOD_VIT);

	if(player:getMainJob() == 19) then -- DNC Main
		-- floor(((Target's VIT + player's CHR)*0.250 + 60),1)
		power = math.floor((vit + chr)*0.25+60);
	else -- DNC Sub
		-- floor(((Target's VIT + player's CHR)*0.125 + 60),1)
		power = math.floor((vit+chr)*0.125+60);
	end

	-- Cap at 94
	if(power>94) then
		power = 94;
	end

	-- Add potency
	potency = waltzPotency(player);
	printf("Potency: %s",potency);
	final = power * (1 + potency);
	
	-- Can't cure more than they need
	maxhp = target:getMaxHP();
	hp = target:getHP();
	diff = (maxhp - hp);
	if(final>diff) then
		final = diff;
	end
	
	-- Floor it.
	final = math.floor(final);
	
	-- Reduce TP
	player:delTP(20);
	
	target:addHP(final);
	player:messageBasic(318,190,final);
	player:updateEnmityFromCure(target,final);
	return final;
end;
Subjob halves the multiplier in all cases.
Curing Waltz: vit+chr * 0.25 + 60, cap at 94 before potency
Curing Waltz II: vit+chr * 0.5 + 130, cap ?
Curing Waltz III: vit+chr * 0.75 + 270, cap?
Curing Waltz IV: vit+chr * 1 + 450, no need for subjob version, cap at 720?
Divine Waltz: vit+chr * 0.25 + 60, 94 cap, already AoEs

Waltz 4 has fixed enmity like Cure V, 400 cumulative and 700 volatile.

There's precious little data on caps, unfortunately. 94 is fairly close to the 93 cap on Cure II, so there may be some correlation there.

Post Reply