• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Request for custom outfits and scripts for NPC!

Seanr

New Member
Joined
Jul 11, 2011
Messages
167
Reaction score
3
Location
Mo Town
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
 
when I do not include "doPlayerAddOutfit(cid, xxx)" The player does not get the outfit.

Here is my outfit.xml. Take a look.

LUA:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
        <list gender="1" lookType="128" name="Citizen">
        <attribute speed="5"/>
        <stats maxHealth="100"/>
            </list>
    </outfit>
 
    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter">
        <skills dist="3"/>
        </list>
        <list gender="1" lookType="129" name="Hunter">
        <skills dist="3"/>
        </list>
    </outfit>
 
    <outfit id="3">
        <list gender="0" lookType="138" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
        <list gender="1" lookType="130" name="Mage">
        <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
    </outfit>
 
    <outfit id="4">
        <list gender="0" lookType="139" name="Knight">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="131" name="Knight">
        <skills sword="3"/>
        </list>
    </outfit> 
 
    <outfit id="5" premium="no">
        <list gender="0" lookType="141" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="133" name="Summoner">
        <stats magLevel="2"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="6" premium="no">
        <list gender="0" lookType="142" name="Warrior">
        <skills sword="3"/>
        </list>
        <list gender="1" lookType="134" name="Warrior">
        <skills sword="3"/>
        </list>
    </outfit>
 
    <outfit id="7" premium="no">
        <list gender="0" lookType="147" name="Barbarian">
        <skills axe="3"/>
        </list>
        <list gender="1" lookType="143" name="Barbarian">
        <skills axe="3"/>
        </list>
    </outfit>
 
    <outfit id="8" premium="no">
        <list gender="0" lookType="148" name="Druid">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="144" name="Druid">
        <stats magLevel="2"/>
        </list>
    </outfit>
 
    <outfit id="9" premium="no">
        <list gender="0" lookType="149" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
        <list gender="1" lookType="145" name="Wizard">
        <stats magLevel="1"/>
        <stats maxMana="100"/>
        </list>
    </outfit>
 
    <outfit id="10" premium="no">
        <list gender="0" lookType="150" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
        <list gender="1" lookType="146" name="Oriental">
        <attribute speed="5"/>
        <stats maxHealth="200"/>
        <stats maxMana="200"/>
            </list>
    </outfit>
 
    <outfit id="11" premium="no">
        <list gender="0" lookType="155" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
        <list gender="1" lookType="151" name="Pirate">
        <stats maxHealth="100"/>
        <skills club="3"/>
        </list>
    </outfit>
 
    <outfit id="12" premium="no" >
        <list gender="0" lookType="156" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
        <list gender="1" lookType="152" name="Assassin">
        <attribute speed="5"/>
        <skills dist="2"/>
            </list>
    </outfit>
 
    <outfit id="13" premium="no" >
        <list gender="0" lookType="157" name="Beggar">
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="153" name="Beggar">
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="14" premium="no" >
        <list gender="0" lookType="158" name="Shaman">
        <stats magLevel="2"/>
        </list>
        <list gender="1" lookType="154" name="Shaman">
        <stats magLevel="2"/>
        </list>
    </outfit> 
 
    <outfit id="15" premium="no" >
        <list gender="0" lookType="269" name="Nightmare">
        <skills shielding="8"/>
        </list>
        <list gender="1" lookType="268" name="Nightmare">
        <skills shielding="8"/>
        </list>
    </outfit>
 
    <outfit id="16" premium="no">
        <list gender="0" lookType="270" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="273" name="Jester">
        <stats maxMana="100"/>
        <attribute speed="5"/>
        <stats maxHealth="100"/>
        </list>
    </outfit>
 
    <outfit id="17" premium="yes" >
        <list gender="0" lookType="279" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
        <list gender="1" lookType="278" name="Brotherhood">
        <stats magLevel="2"/>
        <stats maxHealth="300"/>
        </list>
    </outfit>
 
    <outfit id="18" premium="yes" >
        <list gender="0" lookType="288" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
        <list gender="1" lookType="289" name="Demonhunter">
        <attribute speed="10"/>
        <stats maxHealth="200"/>
        </list>
    </outfit>
 
    <outfit id="19" premium="yes">
        <list gender="0" lookType="366" name="Wayfarer">
	     <attribute speed="15"/>
        	<skills dist="2"/>
	 </list>
        <list gender="1" lookType="367" name="Wayfarer">
	     <attribute speed="15"/>
        	<skills dist="2"/>
	 </list>
    </outfit>     

    <outfit id="20" quest="16438" premium="yes">
        <list gender="0-3" lookType="73" name="Hero"/>	    
    </outfit>    

    <outfit id="21" quest="16439" premium="yes">
	   <list gender="0" lookType="58" name="Exorcist">
	   <stats magLevel="2"/>
        <stats maxMana="200"/>
        </list>
        <list gender="1" lookType="9" name="Nobody">        
        <stats magLevel="2"/>
        <stats maxMana="200"/>     
	   </list>
    </outfit>

    <outfit id="22" quest="16440" premium="yes">
        <list gender="0-3" lookType="255" name="Berserker"/>
    </outfit>     	

    <outfit id="23" quest="16441" premium="yes">
	   <list gender="0" lookType="264" name="Brutetamer">
	   </list>          
        <list gender="1" lookType="253" name="Wildman">        
        </list>
    </outfit>

    <outfit id="24" quest="16442" premium="yes">
        <list gender="0-3" lookType="254" name="Swordsman"/>
    </outfit>     	
   
    <outfit id="25" quest="16443" premium="yes">
        <list gender="0-3" lookType="359" name="Dark Fury"/>
    </outfit>
</outfits>

Maybe it is because you are using list gender="0-3"

try using it like this:
LUA:
 <outfit id="aa" quest="yyyyy" premium="yes">
		<list gender="0" lookType="xx" name="Name"/>
		<list gender="1" lookType="zz" name="Name"/>
	</outfit>

Using one of your scripts for example, it would look like this:
LUA:
 <outfit id="25" quest="16443" premium="yes">
		<list gender="0" lookType="359" name="Dark Fury"/>
		<list gender="1" lookType="359" name="Dark Fury"/>
	</outfit>

hope it helps
 
Okay the script works and I get the outfit and I tried giving addon bonuses like this:

<outfit id="25" quest="16443" premium="yes">
<list gender="0" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
<list gender="1" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
</outfit>



This didn't work. Is there any way I can get this to work in outfits.xml?
 
Okay the script works and I get the outfit and I tried giving addon bonuses like this:

<outfit id="25" quest="16443" premium="yes">
<list gender="0" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
<list gender="1" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
</outfit>



This didn't work. Is there any way I can get this to work in outfits.xml?

If I´m not mistaken, it only works if you have both addons...
Does the player have both addons ?
 
How can I make the outfit count as addons?

Well, to do that you would have to change the sources...

You would need to change a lot of things on outfit.cpp and it would not be easy..

I can´t help you there, I´m sorry, I´m not very good at c++...


Or, you can make it the way I told you earlier, with actions = p
 
I want to add a lot of stuff though. like mana and health increase. resistance to elements. supress drunk and paralyze. give melee and distance and shield skills. a lot of stuff!
 
I want to add a lot of stuff though. like mana and health increase. resistance to elements. supress drunk and paralyze. give melee and distance and shield skills. a lot of stuff!

Well, you have some work to do then...
It is boring, but not hard...

Or you can edit the sources, but I can't help you out with this one


Or even make the NPC give the outfit to the player with 2 addons already...
 
Well, you have some work to do then...
It is boring, but not hard...

Or you can edit the sources, but I can't help you out with this one


Or even make the NPC give the outfit to the player with 2 addons already...



What do you mean by, "Or even make the NPC give the outfit to the player with 2 addons already..." ?
 
What do you mean by, "Or even make the NPC give the outfit to the player with 2 addons already..." ?

Try using this code:
Tell me if it works...

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,
        lookType = xxx
 
        }
 
 
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)
                                        doPlayerAddOutfit(cid, configs.lookType, 3)
					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())


NOTE:
you see
Code:
 lookType = xxx
change that xxx to the lookType of the outfit...

Tell me if it works
hope it helps :)
 
I just got home, so I will try and post back here the results!

EDIT: I still get the outfit just fine. Was I suppose to receive the bonuses i posted above?

v


<outfit id="25" quest="16443" premium="yes">
<list gender="0" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
<list gender="1" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
</outfit>


??
 
Last edited:
I just got home, so I will try and post back here the results!

EDIT: I still get the outfit just fine. Was I suppose to receive the bonuses i posted above?

v


<outfit id="25" quest="16443" premium="yes">
<list gender="0" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
<list gender="1" lookType="359" name="Dark Fury">
<stats magLevel="2"/>
<stats maxHealth="300"/>
</list>
</outfit>


??

Well, I can`t try it out right now...
But, it looks like it might be a problem with the sources...

But lets make one last test...
Place any bonus to a "normal" outfit, like citizen for example...

then log in with a player that have the full citizen addon and see if the he gets the bonus..

If he doesn't it is probably a source problem, and I really don`t know how to solve it
if he does, it is probably a problem with my script... And, if it is a problem with my script I will try to fix it for you

Just make this test and let me know...
 
All outfit addons with bonuses get the bonuses it is just the custom outfits that don't get.

Sorry, didn't see that...
Well, it is probably because the outfits you are using doesn't have addons...

I don´t know how to fix that...

I suggest using login scripts as I have told you...

Sorry for not being able to help = /
 
Back
Top