aliases/variables regarding stances

Posted by Deldro09 on Fri 06 Nov 2009 11:54 PM — 2 posts, 13,492 views.

#0
Hm... to start out, Lua looks quite demanding, but I want to know how can I do an attack where certain moves are based on stances, and if in one particular stance, you can do another set of moves that won't throw the proper stancing/attacks out of order. Here's an example:

Stances: Ein, Vae, Gya, Lya, Riz
Attacks: lateral, vertical.

The alias I want to use is like "bsh" for bash

Inside the alias, if in the Vae stance, I can only do "sitara lateral @target, sitara vertical @target
and if I am in the Ein stance, I have to do Sitara vertical @target, sitara lateral @target

How can that be placed correctly to bash with ease and flow properly between stances, when starting an attack with each denizen?
#1
stances = {
            Ein = { "vertical", "lateral"},
            Vae = {"lateral", "vertical"}
            }
print(stances.Ein[2])
>>lateral
print(stances["Ein"][2])
>>lateral


So if I have a varaible set to my current stance called stance and one called target I can do this.
stances = {
            Ein = { "vertical", "lateral"},
            Vae = {"lateral", "vertical", "as many moves as I want"},
            Gya = {"vertiacal", "side ways", "etc"}
            }
--I use the stance variable to reference the table with the moves in it.
first_move = stances[@stance][1]
second_move = stances[@stance][2]

--I put it together and send it to the MUD
Send("Sitara "..first_move.." "..@target)
Send("Sitara "..second_move.." "..@target)


This is sent to the MUD
>>Sitara vertical goblin
>>Sitara lateral goblin

I didn't test this and I think it's what you where asking for.