SeekerStar Admin replied

550 weeks ago

This is me right now:

@.@

So, for instance, adapted from the one on AH.com for white mage:


function get_sets()
sets.precast = {main="Bolelabunga", head ="Natirah Hat", body= "Vanir Cotehardie", hands="Gendewitha Gages", legs=Orison Pantaloons +2", lring="Ephedra Ring", rring="Prolix Ring"}
sets.midcast = {main="Tamaxchi", head=Gendewitha Caubeen", body="Gendewitha Bliaut" hands="Bokwus Gloves"}
sets.aftercast = {main="Bolelabunga", sub="Genbu's Shield", head="Nefer Khat +1", body="Nefer Kalasiris", hands="Serpentes Cuffs", legs="Nares Trews", lring="Patricius Ring", rring="Dark Ring"}
end

function precast(spell)
equip(sets.precast)
end

function midcast(spell)
equip(sets.midcast)
end

function aftercast(spell)
equip(sets.aftercast)
end

assuming I shoved it into proper list format, this would allow me to pile on the fast cast for precast, then swap to potency immediately, then after I cast it go into refresh set?

Or did I do it wrong?
"Here's a random tip for you. Criticizing the whm is stupid and suicidal. Side effect may include lack of heals in your direction, dancing on your corpse, stubborn refusal to give you raises, laughing and pointing, sudden dirt nap taking due to lack of buffs… "

Alexcennah Default replied

550 weeks ago

It's perfect, it'll do exactly as you said. But this script will do the changes for every action you do, regardless if it's a Cure IV spell, a Benediction or a Realmrazer weaponskill.

SeekerStar Admin replied

550 weeks ago

Which means I need to learn variables and adapt sets accordingly. Which means more figuring it out.

At least I'm on the right track.
"Here's a random tip for you. Criticizing the whm is stupid and suicidal. Side effect may include lack of heals in your direction, dancing on your corpse, stubborn refusal to give you raises, laughing and pointing, sudden dirt nap taking due to lack of buffs… "

Alexcennah Default replied

550 weeks ago

Going on, let's talk about precast, midcast and aftercast events.

For those whom are used to Spellcast, they are the same. Precast happens before the action, midcast immediately after starting the action and aftercast happens after the action has been finished or interrupted. The only difference between how GS and SpellCast handle these lies on the fact the GS knows when events happen based on packets received/sent by/to the server, so we have no need to specify a delay for midcast to happen for example.

Let's look on precast event in my script.

function precast(spell)
	if spell.type == 'WeaponSkill' then	
		if sets.WS[spell.name] then
			equip(sets.WS[spell.name])
		else
			equip(sets.WS.Standard)
		end
	elseif sets.JA[spell.name] then
		equip(sets.JA[spell.name])
	end
end

It starts checking if the action is a weaponskill or not. If true, then check if there is a set with the same name of the weaponskill (I had declared for Exenteratior and Evisceration). If it exists, then equips this set. If not, it'll equip the generic sets.WS.Standard set.

If it's isn't a Weaponskill, it'll check if there is a Job Ability set with the same name as the command sent (again, three sets were definied for that: for Sneak Attack, Trick Attack and Perfect Dodge). If there is, then it'll equip this set.

Note there's no check for Magics. Since this is a Thief set, I didn't bother about it.

Gear sets for precast events should be Fast Cast oriented for spells and potency oriented for Job Abilities and Weapon Skills.


last edited 550 weeks ago by Alexcennah

Alexcennah Default replied

550 weeks ago

The midcast must only be used on spells, since it happens after the command is sent to the server. It's the same as precast in every other aspect, except if you want to do something fancy (like using the cancel_spell() function to cancel it, which will only happen in precast).

The aftercast, again, is the same. Since it happens after everything is done, it's used to change your gear back to idle/dt-/etc sets. In my example:

function aftercast(spell)
	if player.status == 'Engaged' then
		equip(sets.TP[sets.TP.index[TP_ind]])
	else
		equip(sets.Idle)
	end
end

If your character is engaged to a monster, it'll change back to your TP set. If he/she's not, it'll change to your Idle set. Simple.

Note: I'll discuss about that strange TP set definition later. For now, just know that means "my TP set".

SeekerStar Admin replied

550 weeks ago

So let's see if I understand correctly.

GS uses the same if-then that Spellcast used to define actions, and that's what I use to determine which "numbered" set that is used per defined event.

This can also be spell specific? Can I link spell trees (for example, naming Cure to apply for all spells with Cure in their names) or must I enter a different string for each individual spell?

Also, from where does GearCollector grab your stuff? If it's from anywhere in your inventory, I'll be pretty happy.
"Here's a random tip for you. Criticizing the whm is stupid and suicidal. Side effect may include lack of heals in your direction, dancing on your corpse, stubborn refusal to give you raises, laughing and pointing, sudden dirt nap taking due to lack of buffs… "

Alexcennah Default replied

550 weeks ago

As I said before, GS uses common Lua programming, so it allows much more freedom than Spellcast .xml. You can use individual spells declarations, you can use a list of spells, you can check if some spell uses a certain magic skill. Look what I use for my WHM:

function midcast(spell)
	
	if spell.skill == 'Healing Magic' then
		if spell.name:contains("Cure") then
			equip(sets.magic["Healing Magic"].Cure)
		elseif spell.name:contains("Cura") then
			equip(sets.magic["Healing Magic"].Curaga)
		elseif spell.name == "Cursna" then
			equip(sets.magic["Healing Magic"].Cursna)
		end
	elseif sets.magic[spell.skill] then
		equip(sets.magic[spell.skill])
	end

end

First, it checks if the spell uses Healing Magic skill. If true, it checks if the spell's name has "Cure" on it. Then it checks for the string "Cura" (it can be Cura or Curaga). Then it checks if it's Cursna. It checks no more for no other Healing Magic.

Alexcennah Default replied

550 weeks ago

And GearCollector can grab items from everywhere, except from Wardrobe.

I will take my son for a walk, be back soon.

SeekerStar Admin replied

550 weeks ago

Oh holy crap, no wonder you guys all yell at me to use it already.

And not grabbing from wardrobe isn't a big deal because the game tends to do that anyway.

So… using the same macc sets between jobs is just a matter of copy/paste?
"Here's a random tip for you. Criticizing the whm is stupid and suicidal. Side effect may include lack of heals in your direction, dancing on your corpse, stubborn refusal to give you raises, laughing and pointing, sudden dirt nap taking due to lack of buffs… "

Alexcennah Default replied

550 weeks ago

I'm back.

If you're talking about gear sets, if both jobs can equip the same gear, why not? If you're talking about scripts' logic, again: why not? That's what we do, making adjustments when and where it's needed. For exemple, my GEO.lua is mostly the same as my BLM.lua, with minimal changes asides gearsets. Same goes as THF, MNK and SAM. However, BLU is another case, so as BRD and RUN. These 3 jobs are somewhat unique, so their .luas are more specialized. But even then, they have a good portion of their codes in common with other jobs' .luas.
Please log in to post a reply.