Ezzz
Developer of Nostalrius and The Violet Project
I'm wondering if you guys find this code system, hard to do;
Lua:
local Behavior = {
{key = "name|job", text = "You are %N."},
{Bool = not msgcontains(msg, "healing") and not msgcontains(msg, "support") and Knight(cid), key = "spell", text = "I can teach you healing spells and support spells. What kind of spell do you wish to learn? You can also tell me for which level you would like to learn a spell, if you prefer that.", SetTopic = 1},
{key = "spell", text = "Sorry, only for knights."},
{key = "key", text = "Do you want to buy the key for %P gold?", Price = 0, Amount = 1, Type = 2086, Action = 100, SetTopic = 5},
{Bool = isTopic(config, 5) and CountMoney(cid)>=config.Price, key = "yes", text = "Here you are.", Create = config.Type},
{Bool = isTopic(config, 5), key = "yes", text = "You have no money."},
{Bool = isTopic(config, 5), key = msg, text = "Other day."},
{Bool = Count(msg)>1 and notSell(msg), key = "apple", Price = 2*Count(msg), Type = 2376, Amount = Count(msg), text = "Do you want to buy %A red apples for %P gold?", SetTopic = 2},
{Bool = Count(msg)>1, key = "apple", Price = 1*Count(msg), Type = 2376, Amount = Count(msg), text = "Do you want to sell %A red apples for %P gold?", SetTopic = 4},
{Bool = notSell(msg), key = "apple", Price = 2, Type = 2376, Amount = 1, text = "Do you want to buy a red apple for %P gold?", SetTopic = 2},
{key = "apple", Price = 1, Type = 2376, Amount = 1, text = "Do you want to sell a red apple for %P gold?", SetTopic = 4},
{Bool = Knight(cid), key = "light", text = "Do you want to buy the spell 'Light' for %P gold?", Price = 100, Spell = "light", SetTopic = 3},
{Bool = Knight(cid), key = "healing spell", text = "In this category I have 'Light Healing' and 'Antidote'."},
{Bool = Knight(cid), key = "support spell", text = "In this category I have 'Light', 'Find Person' and 'Great Light'."},
{Bool = Knight(cid) and isTopic(config, 1), key = "8", text = "For level 8 I have 'Find Person' and 'Light'.", SetTopic = 1},
{Bool = Knight(cid) and isTopic(config, 1), key = "9", text = "For level 9 I have 'Light Healing'.", SetTopic = 1},
{Bool = Knight(cid) and isTopic(config, 1), key = "10", text = "For level 10 I have 'Antidote'.", SetTopic = 1},
{Bool = Knight(cid) and isTopic(config, 1), key = "13", text = "For level 13 I have 'Great Light'.", SetTopic = 1},
{Bool = Knight(cid) and isTopic(config, 1), key = msg .. "$", text = "Sorry, I have only spells for level 8, 9, 10 and 13.", SetTopic = 1},
{Bool = isTopic(config, 3) and SpellKnown(cid, config.Spell)==1, key = "yes", text = "You have already learned this spell."},
{Bool = isTopic(config, 3) and Level(cid)<SpellLevel(cid, config.Spell), key = "yes", text = "You have to be level %A, %N.", Amount = SpellLevel(cid, config.Spell)},
{Bool = isTopic(config, 3) and SpellKnown(cid, config.Spell)==0 and CountMoney(cid)>=config.Price, key = "yes", text = "Here you are.", DeleteMoney = config.Price, LearnSpell = config.Spell, EffectOpp=13},
{Bool = isTopic(config, 3) and CountMoney(cid)<config.Price, key = "yes", text = "You have not enough money."},
{Bool = isTopic(config, 3), key = msg, text = "Maybe other time."},
{Bool = isTopic(config, 2) and CountMoney(cid)>=config.Price, key = "yes", text = "Thank you!", Create = config.Type, DeleteMoney = config.Price},
{Bool = isTopic(config, 2), key = "yes", text = "Atleast someone is poorer than me!"},
{Bool = isTopic(config, 2), key = msg, text = "Other day then."},
{Bool = isTopic(config, 4) and ItemCount(cid, config.Type)>=config.Amount, key = "yes", text = "Thank you!", Delete = config.Type, CreateMoney = config.Price},
{Bool = isTopic(config, 4), key = "yes", text = "Atleast someone is poorer than me!"},
{Bool = isTopic(config, 4), key = msg, text = "Other day then."}
}