SOLVED & FINISHED
Please move this to Resources/Talkactions.
Distro: OTServ 0.6.4 STABLE
Client: 8.6
What?:
Improved Addon Doll (Talkaction)
Made by Xeraphus.
How To Use?:
!addon <name of the outfit>
Scripts:
addon.lua (..\<your distro>\data\talkactions\scripts\custom)
talkactions.xml (..\<your distro>\data\talkactions)
Please move this to Resources/Talkactions.
Distro: OTServ 0.6.4 STABLE
Client: 8.6
What?:
Improved Addon Doll (Talkaction)
Made by Xeraphus.
How To Use?:
!addon <name of the outfit>
Scripts:
addon.lua (..\<your distro>\data\talkactions\scripts\custom)
Code:
local ADDON_DOLL = 9693 --ID of Addon Doll
local outfits = {
[0] = {
["citizen"] = 136,
["hunter"] = 137,
["mage"] = 138,
["knight"] = 139,
["nobleman"] = 140,
["summoner"] = 141,
["warrior"] = 142,
["barbarian"] = 147,
["druid"] = 148,
["wizard"] = 149,
["oriental"] = 150,
["pirate"] = 155,
["assassin"] = 156,
["beggar"] = 157,
["shaman"] = 158,
["norsewoman"] = 252,
["nightmare"] = 269,
["jester"] = 270,
["brotherhood"] = 279,
["demonhunter"] = 288,
["yalaharian"] = 324
},
[1] = {
["citizen"] = 128,
["hunter"] = 129,
["mage"] = 130,
["knight"] = 131,
["nobleman"] = 132,
["summoner"] = 133,
["warrior"] = 134,
["barbarian"] = 143,
["druid"] = 144,
["wizard"] = 145,
["oriental"] = 146,
["pirate"] = 151,
["assassin"] = 152,
["beggar"] = 153,
["shaman"] = 154,
["norsewoman"] = 251,
["nightmare"] = 268,
["jester"] = 273,
["brotherhood"] = 278,
["demonhunter"] = 289,
["yalaharian"] = 325
}
}
local msg = {
success = "Full addon set successfully added!",
invalidParam = "Command requires a valid parameter.",
hasAddons = "You already have the addons for this outfit.",
needDoll = "You do not have an addon doll.",
invalidOutfit = "You must put a valid outfit name."
}
function onSay(cid, words, param)
local param = string.lower(param)
if (param == "") then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg.invalidParam)
end
if (getPlayerItemCount(cid, ADDON_DOLL) == 0) then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg.needDoll)
end
local outfit = outfits[getPlayerSex(cid)][param]
if not outfit then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg.invalidOutfit)
end
if (canPlayerWearOutfit(cid, outfit, 3)) then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg.hasAddons)
end
doPlayerRemoveItem(cid, ADDON_DOLL, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg.success)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerAddOutfit(cid, outfit, 3)
return true
end
talkactions.xml (..\<your distro>\data\talkactions)
Code:
<talkaction words="!addon" filter="first word" script="custom/addon.lua"/>
Last edited: