RNG Gearswap Coding Help: Hauksbok Arrow

Language: JP EN DE FR
New Items
2022-08-11
329 users online
Forum » FFXI » Jobs » Ranger » RNG Gearswap coding help: Hauksbok Arrow
RNG Gearswap coding help: Hauksbok Arrow
 Bismarck.Claddy
Offline
Server: Bismarck
Game: FFXI
user: cladbolg
Posts: 12
By Bismarck.Claddy 2020-07-15 18:14:23
Link | Quote | Reply
 
Any one have a code where it wont let you shoot the arrow?
I've seen some lua's that have this feature built in, but I suck with code so I don't know what to look for.

I know, I know that I can add an ammo="whatever arrow" in every set, but even with that I've shot an Animikii Bullet on COR before.

Thanks for your help.
 Leviathan.Isiolia
Offline
Server: Leviathan
Game: FFXI
user: Isiolia
Posts: 451
By Leviathan.Isiolia 2020-07-15 19:03:57
Link | Quote | Reply
 
This is what I have in my job_precast section:
Code
if spell.action_type == 'Ranged Attack' or (spell.type == 'WeaponSkill' and spell.skill == 'Archery') then
        if player.equipment.ammo == "Hauksbok Arrow"
			then cancel_spell()
				add_to_chat(122, "Don't shoot the Precious!!!")
		end
    end


Not 100% comprehensive though, as it wouldn't prevent you from, say, losing it to Bounty Shot. Still, you could start with that and expand if you want. Obviously, you can just specify a different arrow when testing.
[+]
 Fenrir.Skarwind
Offline
Server: Fenrir
Game: FFXI
user: Skarwind
Posts: 3160
By Fenrir.Skarwind 2020-07-17 08:08:44
Link | Quote | Reply
 
Such fail on S/E's part for not just giving us a pouch/quiver that expends 1 bullet/arrow/bolt per day. Hell they are rare/ex so it isn't game breaking.
[+]
necroskull Necro Bump Detected! [798 days between previous and next post]
 Phoenix.Iocus
Offline
Server: Phoenix
Game: FFXI
user: androwe
Posts: 354
By Phoenix.Iocus 2022-09-23 08:38:02
Link | Quote | Reply
 
Idk if this helps anyone else, the previous post was super useful to me. This stops me from using it during bounty shot and equips Artemis Arrows instead. Obviously you can change it to a different arrow.

I would test it with a target over 30 yalms just to make sure it's working before live firing it.
Code
if spell.action_type == 'Ranged Attack' or (spell.type == 'WeaponSkill' and spell.skill == 'Archery') or spell.english == 'Bounty Shot' then
		if player.equipment.ammo == "Hauksbok Arrow"
		then cancel_spell()
			add_to_chat(122, "Don't shoot the Precious!")
			equip({ammo="Artemis's Arrow"})
		end
	end
[+]
Log in to post.