Hey, I am new to this website but I haven't found any help anywhere else.
I want to add custom outfits into my server like, Hero, Necromancer, and others like the barbarian outfits and this is self explanatory.
However, I need help scripting an NPC who will make these outfits appear in a player's "Change Outfit" option after the player gives the NPC a special item. I don't want the outfits going away when the player changes to a different outfit or goes invis or whatever. I want the player to be able to go to that outfit at any time if he/she chooses to change outfits.
Also, if anyone can help me script raids for creatures to drop these items that would be helpful.
Sincerely,
Sean
Ok, I just made this script for you, hope this is what you are looking for
go to data/XML/outfits.xml
probably the last lines will look something like this:
Lua:
<outfit id="35" access="5" premium="yes">
<list gender="0-3" lookType="302" name="God"/>
</outfit>
</outfits>
Now, before </outfit
s> and below the last </outfit>
add this:
Lua:
<outfit id="aa" quest="yyyyy" premium="yes">
<list gender="0" lookType="xx" name="Name"/>
<list gender="1" lookType="zz" name="Name"/>
</outfit>
Now, change the
to the number of you last outfit +1 for example if it was 33 make this new one 34
change those y's to a storage value, any number you want, like 15255, or whatever, just be sure it is not used for any other quests...
change the xx and the zz to the lookType of the monster you want, it can be found at the monster.xml file...
change the Name (the second one) to the name of the outfit like, hero, elf, etc
Ok, now you created your outfit...
Lets make the NPC that will give the player the outfit...
go to data/npc and make a new xml file, name it as you want and place this inside:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Name" script="data/npc/scripts/outfiter.lua" walkinterval="2000" floorchange="0">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="133" head="114" body="119" legs="132" feet="114"/>
<parameters>
<parameter key="message_greet" value="Hello, |PLAYERNAME|."/>
<parameter key="message_farewell" value="Farewell, |PLAYERNAME|"/>
<parameter key="message_walkaway" value="Farewell, |PLAYERNAME|" />
</parameters>
</npc>
change
to whatever you want the npc name to be, it must be the same name as the file...
now go to data/npc/scripts make a new lua file and name it outfiter
place this inside:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local configs = {
ItemId = 2455,
ItemCount = 1,
Storage = 2321,
}
if(msgcontains(msg, 'outfit')) then
if (getPlayerStorageValue(cid, configs.Storage) > 0) then
selfSay('You already have this outfit.', cid)
talkState[talkUser] = 0
else
selfSay('Do you have all the items for the new outfit ?', cid)
talkState[talkUser] = 1
end
else
if(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerItemCount(cid, configs.ItemId) == configs.ItemCount) then
doPlayerRemoveItem(cid, configs.ItemId, configs.ItemCount)
setPlayerStorageValue(cid, configs.Storage, 1)
doSendMagicEffect(getPlayerPosition(cid), 12)
selfSay('Congratz, you now have a brand new outfit.', cid)
talkState[talkUser] = 0
else
selfSay('You don\'t have all the items.', cid)
talkState[talkUser] = 0
end
end
return TRUE
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
now change this:
Code:
local configs = {
ItemId = 2548,
ItemCount = 1,
Storage = 224789,
}
change that 2548 to the id of the item you want.
change that it to the amount of that items it will be needed
change that 24789 to the
same code you have put on the outfits.xml on quest="yyyyy"
Hope it helps
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)