• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Npcs based on 8.0 and sometimes also 8.1

Sentielo

Advanced OT User
Joined
Feb 3, 2008
Messages
2,388
Reaction score
226
Location
I am from Holland, where the fack you from :)
Hello guys,
I would like to share my npc scripts with other guys so here are them.


Here is my global.lua, you need it for the functions:
Code:
TRUE = 1
FALSE = 0

LUA_ERROR = -1
LUA_NO_ERROR = 0

NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
SOUTHWEST = 4
SOUTHEAST = 5
NORTHWEST = 6
NORTHEAST = 7

COMBAT_FORMULA_UNDEFINED = 0
COMBAT_FORMULA_LEVELMAGIC = 1
COMBAT_FORMULA_SKILL = 2

CONDITION_PARAM_OWNER = 1
CONDITION_PARAM_TICKS = 2
CONDITION_PARAM_OUTFIT = 3
CONDITION_PARAM_HEALTHGAIN = 4
CONDITION_PARAM_HEALTHTICKS = 5
CONDITION_PARAM_MANAGAIN = 6
CONDITION_PARAM_MANATICKS = 7
CONDITION_PARAM_DELAYED = 8
CONDITION_PARAM_SPEED = 9
CONDITION_PARAM_LIGHT_LEVEL = 10
CONDITION_PARAM_LIGHT_COLOR = 11
CONDITION_PARAM_SOULGAIN = 12
CONDITION_PARAM_SOULTICKS = 13
CONDITION_PARAM_MINVALUE = 14
CONDITION_PARAM_MAXVALUE = 15
CONDITION_PARAM_STARTVALUE = 16
CONDITION_PARAM_TICKINTERVAL = 17
CONDITION_PARAM_FORCEUPDATE = 18
CONDITION_PARAM_SKILL_MELEE = 19
CONDITION_PARAM_SKILL_FIST = 20
CONDITION_PARAM_SKILL_CLUB = 21
CONDITION_PARAM_SKILL_SWORD = 22
CONDITION_PARAM_SKILL_AXE = 23
CONDITION_PARAM_SKILL_DISTANCE = 24
CONDITION_PARAM_SKILL_SHIELD = 25
CONDITION_PARAM_SKILL_FISHING = 26
CONDITION_PARAM_STAT_MAXHITPOINTS = 27
CONDITION_PARAM_STAT_MAXMANAPOINTS = 28
CONDITION_PARAM_STAT_SOULPOINTS = 29
CONDITION_PARAM_STAT_MAGICPOINTS = 30
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = 31
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = 32
CONDITION_PARAM_STAT_SOULPOINTSPERCENT = 33
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = 34

COMBAT_PARAM_TYPE = 1
COMBAT_PARAM_EFFECT = 2
COMBAT_PARAM_DISTANCEEFFECT = 3
COMBAT_PARAM_BLOCKSHIELD = 4
COMBAT_PARAM_BLOCKARMOR = 5
COMBAT_PARAM_TARGETCASTERORTOPMOST = 6
COMBAT_PARAM_CREATEITEM = 7
COMBAT_PARAM_AGGRESSIVE = 8
COMBAT_PARAM_DISPEL = 9

CALLBACK_PARAM_LEVELMAGICVALUE = 1
CALLBACK_PARAM_SKILLVALUE = 2
CALLBACK_PARAM_TARGETTILE = 3
CALLBACK_PARAM_TARGETCREATURE = 4

COMBAT_NONE = 0
COMBAT_PHYSICALDAMAGE = 1
COMBAT_ENERGYDAMAGE = 2
COMBAT_POISONDAMAGE = 4 
COMBAT_FIREDAMAGE = 8
COMBAT_UNDEFINEDDAMAGE = 16
COMBAT_LIFEDRAIN = 32
COMBAT_MANADRAIN = 64
COMBAT_HEALING = 128
COMBAT_DROWNDAMAGE = 256

CONDITION_NONE = 0
CONDITION_POISON = 1
CONDITION_FIRE = 2
CONDITION_ENERGY = 4
CONDITION_LIFEDRAIN = 8
CONDITION_HASTE = 16
CONDITION_PARALYZE = 32
CONDITION_OUTFIT = 64
CONDITION_INVISIBLE = 128
CONDITION_LIGHT = 256
CONDITION_MANASHIELD = 512
CONDITION_INFIGHT = 1024
CONDITION_DRUNK = 2048
CONDITION_EXHAUSTED = 4096
CONDITION_FOOD = 8192
CONDITION_REGENERATION = 8192
CONDITION_SOUL = 16384
CONDITION_DROWN = 32768
CONDITION_MUTED = 65536
CONDITION_TRADETICKS = 131072
CONDITION_YELLTICKS = 262144
CONDITION_ATTRIBUTES = 524288

CONST_SLOT_HEAD = 1
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10

CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_ENERGYAREA = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_BLUE = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_NONE = 255

CONST_ANI_SPEAR = 0
CONST_ANI_BOLT = 1
CONST_ANI_ARROW = 2
CONST_ANI_FIRE = 3
CONST_ANI_ENERGY = 4
CONST_ANI_POISONARROW = 5
CONST_ANI_BURSTARROW = 6
CONST_ANI_THROWINGSTAR = 7
CONST_ANI_THROWINGKNIFE = 8
CONST_ANI_SMALLSTONE = 9
CONST_ANI_SUDDENDEATH = 10
CONST_ANI_LARGEROCK = 11
CONST_ANI_SNOWBALL = 12
CONST_ANI_POWERBOLT = 13
CONST_ANI_POISON = 14
CONST_ANI_INFERNALBOLT = 15
CONST_ANI_HUNTINGSPEAR = 16
CONST_ANI_ENCHANTEDSPEAR = 17
CONST_ANI_REDSTAR = 18
CONST_ANI_GREENSTAR = 19
CONST_ANI_ROYALSPEAR = 20
CONST_ANI_SNIPERARROW = 21
CONST_ANI_ONYXARROW = 22
CONST_ANI_PIERCINGBOLT = 23
CONST_ANI_WHIRLWINDSWORD = 24
CONST_ANI_WHIRLWINDAXE = 25
CONST_ANI_WHIRLWINDCLUB = 26
CONST_ANI_ETHEREALSPEAR = 27
CONST_ANI_WEAPONTYPE = 254
CONST_ANI_NONE = 255

TALKTYPE_SAY  = 1
TALKTYPE_WHISPER = 2
TALKTYPE_YELL = 3
TALKTYPE_PRIVATE = 4
TALKTYPE_CHANNEL_Y = 5
TALKTYPE_BROADCAST = 9
TALKTYPE_CHANNEL_R1 = 10
TALKTYPE_PRIVATE_RED = 11
TALKTYPE_CHANNEL_O = 12
TALKTYPE_CHANNEL_R2 = 14
TALKTYPE_ORANGE_1 = 16
TALKTYPE_ORANGE_2 = 17

MESSAGE_STATUS_WARNING = 18
MESSAGE_EVENT_ADVANCE = 19
MESSAGE_EVENT_DEFAULT = 20
MESSAGE_STATUS_DEFAULT = 21
MESSAGE_INFO_DESCR = 22
MESSAGE_STATUS_SMALL = 23
MESSAGE_STATUS_CONSOLE_BLUE = 24
MESSAGE_STATUS_CONSOLE_RED  = 25

TEXTCOLOR_BLUE = 5
TEXTCOLOR_LIGHTBLUE = 35
TEXTCOLOR_LIGHTGREEN = 30
TEXTCOLOR_CRYSTAL = 65
TEXTCOLOR_PLATINUM = 89
TEXTCOLOR_LIGHTGREY = 129
TEXTCOLOR_RED = 180
TEXTCOLOR_ORANGE = 198
TEXTCOLOR_GOLD = 210
TEXTCOLOR_WHITE_EXP = 215
TEXTCOLOR_NONE = 255

SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6

CONTAINER_POSITION = 65535

STACKPOS_GROUND = 0
STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5
STACKPOS_TOP_CREATURE = 253
STACKPOS_TOP_FIELD = 254
STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE = 255

RETURNVALUE_NOERROR = 1
RETURNVALUE_NOTPOSSIBLE = 2
RETURNVALUE_NOTENOUGHROOM = 3
RETURNVALUE_PLAYERISPZLOCKED = 4
RETURNVALUE_PLAYERISNOTINVITED = 5
RETURNVALUE_CANNOTTHROW = 6
RETURNVALUE_THEREISNOWAY = 7
RETURNVALUE_DESTINATIONOUTOFREACH = 8
RETURNVALUE_CREATUREBLOCK = 9
RETURNVALUE_NOTMOVEABLE = 10
RETURNVALUE_DROPTWOHANDEDITEM = 11
RETURNVALUE_BOTHHANDSNEEDTOBEFREE = 12
RETURNVALUE_CANONLYUSEONEWEAPON = 13
RETURNVALUE_NEEDEXCHANGE = 14
RETURNVALUE_CANNOTBEDRESSED = 15
RETURNVALUE_PUTTHISOBJECTINYOURHAND = 16
RETURNVALUE_PUTTHISOBJECTINBOTHHANDS = 17
RETURNVALUE_TOOFARAWAY = 18
RETURNVALUE_FIRSTGODOWNSTAIRS = 19
RETURNVALUE_FIRSTGOUPSTAIRS = 20
RETURNVALUE_CONTAINERNOTENOUGHROOM = 21
RETURNVALUE_NOTENOUGHCAPACITY = 22
RETURNVALUE_CANNOTPICKUP = 23
RETURNVALUE_THISISIMPOSSIBLE = 24
RETURNVALUE_DEPOTISFULL = 25
RETURNVALUE_CREATUREDOESNOTEXIST = 26
RETURNVALUE_CANNOTUSETHISOBJECT = 27
RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE = 28
RETURNVALUE_NOTREQUIREDLEVELTOUSERUNE = 29
RETURNVALUE_YOUAREALREADYTRADING = 30
RETURNVALUE_THISPLAYERISALREADYTRADING = 31
RETURNVALUE_YOUMAYNOTLOGOUTDURINGAFIGHT = 32
RETURNVALUE_DIRECTPLAYERSHOOT = 33
RETURNVALUE_NOTENOUGHLEVEL = 34
RETURNVALUE_NOTENOUGHMAGICLEVEL = 35
RETURNVALUE_NOTENOUGHMANA = 36
RETURNVALUE_NOTENOUGHSOUL = 37
RETURNVALUE_YOUAREEXHAUSTED = 38
RETURNVALUE_PLAYERISNOTREACHABLE = 39
RETURNVALUE_CANONLYUSETHISRUNEONCREATURES = 40
RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE = 41
RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER = 42
RETURNVALUE_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE = 43
RETURNVALUE_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE = 44
RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE = 45
RETURNVALUE_YOUMAYNOTLOGOUTHERE = 46
RETURNVALUE_YOUCANONLYUSEITONCREATURES = 47
RETURNVALUE_CREATUREISNOTREACHABLE = 48
RETURNVALUE_SECUREMODEON = 49

doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1539] = 1540, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085, [5098] = 5100, [5099] = 5100, [5101] = 5102, [5107] = 5109, [5108] = 5109, [5110] = 5111, [5116] = 5118, [5117] = 5118, [5119] = 5120, [5125] = 5127, [5126] = 5127, [5128] = 5129, [5134] = 5136, [5135] = 5136, [5137] = 5139, [5138] = 5139, [5140] = 5142, [5141] = 5142, [5143] = 5145, [5144] = 5145, [5278] = 5280, [5279] = 5280, [5281] = 5283, [5282] = 5283, [5284] = 5285, [5286] = 5287, [5515] = 5516, [5517] = 5518, [5732] = 5734, [5733] = 5734, [5735] = 5737, [5736] = 5737, [6192] = 6194, [6193] = 6194, [6195] = 6197, [6196] = 6197, [6198] = 6199, [6200] = 6201, [6249] = 6251, [6250] = 6251, [6252] = 6254, [6253] = 6254, [6255] = 6256, [6257] = 6258, [6795] = 6796, [6797] = 6798, [6799] = 6800, [6801] = 6802, [6891] = 6893, [6892] = 6893, [6894] = 6895, [6900] = 6902, [6901] = 6902, [6903] = 6904, [7033] = 7035, [7034] = 7035, [7036] = 7037, [7042] = 7044, [7043] = 7044, [7045] = 7046, [7054] = 7055, [7056] = 7057}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057}
questDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049}
levelDoors = {1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130, 5292, 5294, 6206, 6208, 6263, 6265, 6896, 6905, 7038, 7047}
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092}

BLUEBERRYBUSH_DECAY_INTERVAL = 300000

ITEMCOUNT_MAX = 100

ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
ITEM_FISH = 2667
ITEM_WORM = 3976
ITEM_BLUEBERRY = 2677
ITEM_BLUEBERRYBUSH = 2785
ITEM_BUSH = 2786
ITEM_PARCEL = 2595
ITEM_LABEL = 2599
ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160


function doPlayerGiveItem(cid, itemid, count, charges)
	local hasCharges = (isItemRune(itemid) == TRUE or isItemFluidContainer(itemid) == TRUE)
	if(hasCharges and charges == nil) then
		charges = 1
	end
	
	while count > 0 do
    	local tempcount = 1
    	
    	if(hasCharges) then
    		tempcount = charges
    	end
    	if(isItemStackable(itemid) == TRUE) then
    		tempcount = math.min (100, count)
   		end
    	
       	local ret = doPlayerAddItem(cid, itemid, tempcount)
       	if(ret == LUA_ERROR) then
        	ret = doCreateItem(itemid, tempcount, getPlayerPosition(cid))
        end
        
        if(ret ~= LUA_ERROR) then
        	if(hasCharges) then
        		count = count-1
        	else
        		count = count-tempcount
        	end
        else
        	return LUA_ERROR
        end
	end
    return LUA_NO_ERROR
end


function doPlayerTakeItem(cid, itemid, count)
	if(getPlayerItemCount(cid,itemid) >= count) then
		
		while count > 0 do
			local tempcount = 0
    		if(isItemStackable(itemid) == TRUE) then
    			tempcount = math.min (100, count)
    		else
    			tempcount = 1
    		end
        	local ret = doPlayerRemoveItem(cid, itemid, tempcount)
        	
            if(ret ~= LUA_ERROR) then
            	count = count-tempcount
            else
            	return LUA_ERROR
            end
		end
		
		if(count == 0) then
			return LUA_NO_ERROR
		end
		
	else
		return LUA_ERROR
	end
end


function doPlayerAddMoney(cid, amount)
	local crystals = math.floor(amount/10000)
	amount = amount - crystals*10000
	local platinum = math.floor(amount/100)
	amount = amount - platinum*100
	local gold = amount
	local ret = 0
	if(crystals > 0) then
		ret = doPlayerGiveItem(cid, ITEM_CRYSTAL_COIN, crystals)
		if(ret ~= LUA_NO_ERROR) then
			return LUA_ERROR
		end
	end
	if(platinum > 0) then
		ret = doPlayerGiveItem(cid, ITEM_PLATINUM_COIN, platinum)
		if(ret ~= LUA_NO_ERROR) then
			return LUA_ERROR
		end
	end
	if(gold > 0) then
		ret = doPlayerGiveItem(cid, ITEM_GOLD_COIN, gold)
		if(ret ~= LUA_NO_ERROR) then
			return LUA_ERROR
		end
	end
	return LUA_NO_ERROR
end


function doPlayerBuyItem(cid, itemid, count, cost, charges)
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
    	return doPlayerGiveItem(cid, itemid, count, charges)
    else
        return LUA_ERROR
    end
end


function doPlayerSellItem(cid, itemid, count, cost)
	
	if(doPlayerTakeItem(cid, itemid, count) == LUA_NO_ERROR) then
		if(doPlayerAddMoney(cid, cost) ~= LUA_NO_ERROR) then
			error('Could not add money to ' .. getPlayerName(cid) .. '(' .. cost .. 'gp)')
		end
		return LUA_NO_ERROR
	else
		return LUA_ERROR
	end
	
end

function isInRange(pos, fromPos, toPos)
	if pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z then
		return TRUE
	end
	return FALSE
end

function isNumber(p)
	local m = ""
	for i = 1, string.len(p) do
		m = string.sub(p, i, i)
		if m == "0" or m == "1" or m == "2" or m == "3" or m == "4" or m == "5" or m == "6" or m == "7" or m == "8" or m == "9" then
			-- continue
		else
			return FALSE
		end
	end
	return TRUE
end

function isPremium(cid)
	if isPlayer(cid) == TRUE and getPlayerPremiumDays(cid) > 0 then
		return TRUE
	end
	return FALSE
end

function rows(connection, sql_statement)
	local cursor = assert(connection:execute(sql_statement))
	return function ()
		return cursor:fetch()
	end
end

function getMonthDayEnding(day)
	if day == "01" then
		return "st"
	elseif day == "02" then
		return "nd"
	elseif day == "03" then
		return "rd"
	else
		return "th"
	end
end

function getMonthString(month)
	if month == 1 then
		return "January"
	elseif month == 2 then
		return "February"
	elseif month == 3 then
		return "March"
	elseif month == 4 then
		return "April"
	elseif month == 5 then
		return "May"
	elseif month == 6 then
		return "June"
	elseif month == 7 then
		return "July"
	elseif month == 8 then
		return "August"
	elseif month == 9 then
		return "September"
	elseif month == 10 then
		return "October"
	elseif month == 11 then
		return "November"
	elseif month == 12 then
		return "December"
	end
end

function getArticle(str)
	if string.find(str, "[A,a,E,e,I,i,O,o,U,u,Y,y]") == TRUE then
		return "an"
	end
	return "a"
end

function getDistanceBetween(firstPosition, secondPosition)
	local xDif = math.abs(firstPosition.x - secondPosition.x)
	local yDif = math.abs(firstPosition.y - secondPosition.y)

	local posDif = math.max(xDif, yDif)
	if(firstPosition.z ~= secondPosition.z) then
		posDif = posDif + 9 + 6
	end
	return posDif
end

PLAYERSLOT_FIRST = 1
PLAYERSLOT_LAST = 10
function removePlayerItemsWithCharges(cid, itemid, charges)
    if(isItemRune(itemid) ~= TRUE and isItemFluidContainer(itemid) ~= TRUE) then
        error('[Error] removePlayerItemsWithCharges: Item ' .. itemid .. ' is not a rune or fluid container.', 2)
        return 0
    end
    
    local n = 0
    
    for slot = PLAYERSLOT_FIRST, PLAYERSLOT_LAST, 1 do
        local item = getPlayerSlotItem(cid, slot)
        if(item.itemid > 0) then
            if(item.itemid == itemid and item.type == charges) then
                if(doRemoveItem(item.uid, -1) == LUA_NO_ERROR) then
                    n = n + 1
                else
                    print('[Warning] removePlayerItemsWithCharges: ', 'Could not remove item with uid ' .. item.uid)
                end
            elseif(isContainer(item.uid) == TRUE) then
                n = n + removeContainerItemsWithCharges(item.uid, itemid, charges)
            end
        end
    end
    
    return n
    
end

function removeContainerItemsWithCharges(uid, itemid, charges)
    if(isItemRune(itemid) ~= TRUE and isItemFluidContainer(itemid) ~= TRUE) then
        error('[Error] removeContainerItemsWithCharges: Item ' .. itemid .. ' is not a rune or fluid container.', 2)
        return 0
    end
    
    local n = 0
    
    local slot = 0
    local cap = getContainerCap(uid)
    while(slot <= cap) do
        local item = getContainerItem(uid, slot)
        if(item.itemid > 0) then
            if(item.itemid == itemid and item.type == charges) then
                if(doRemoveItem(item.uid, -1) == LUA_NO_ERROR) then
                    n = n+1
                    slot = slot-1
                else
                    print('[Warning] removeContainerItemsWithCharges: ', 'Could not remove item with uid ' .. item.uid)
                end
            elseif(isContainer(item.uid) == TRUE) then
                n = n + removeContainerItemsWithCharges(item.uid, itemid, charges)
            end
        end
        slot = slot+1
    end
    
    return n
end

So let's start with the scripts.
First of all I would like to introduce you my rune npc + vial.

Add to Frank.xml:
Code:
<npc name="Frank" script="data/npc/scripts/runes.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="133" head="114" body="94" legs="19" feet="0" addons="3" corpse="2212"/>

<parameters>

<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell spellbooks(150gp) blank runes(10gp), missile, explosive, field, wall, bomb, healing and other spell runes! I also sell wands and rods and I buy all vials (5gp each)." />
<parameter key="message_needmoremoney" value="You do not have enough money." />
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you?" />

</parameters>

</npc>

add to runes.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


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 returnVials(cid, message, keywords, parameters, node)
	if(npcHandler.focus ~= cid) then
		return false
	end
	
	local amount = removePlayerItemsWithCharges(cid, parameters.itemid, parameters.charges)
	if(amount <= 0) then
		npcHandler:say('You do not have any.')
	else
		local price = amount*parameters.cost
		if(doPlayerAddMoney(cid, price) == LUA_NO_ERROR) then
			npcHandler:say('Here are your reward of ' .. price .. ' gold coins. It was a pleasure doing business with you.')
		else
			error('[Error] returnVials:', 'Could not give ' .. price .. ' gold coins to player ' .. getPlayerName(cid))
		end
	end
	npcHandler:resetNpc()
	return true
end


local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

keywordHandler:addKeyword({'missile runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell light magic missile(40gp), heavy magic missile(125gp) and sudden death(325gp) runes.'})
keywordHandler:addKeyword({'explosive runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell fireball(95gp), great fireball(180gp) and explosion(250gp) runes.'})
keywordHandler:addKeyword({'field runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell fire field(85gp), energy field(115gp), poison field(65gp) and destroy field(45gp) runes.'})
keywordHandler:addKeyword({'wall runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell fire wall(245gp), energy wall(340gp) and poison wall(210gp) runes. I also sell magic wall runes for 350gp.'})
keywordHandler:addKeyword({'bomb runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell fire bomb(210gp), poison bomb(170gp) and energy bomb(325gp) runes.'})
keywordHandler:addKeyword({'healing runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell antidote(65gp), intense healing(95gp) and ultimate healing(175gp) runes.'})
keywordHandler:addKeyword({'other spell runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell convince creature(80gp) and chameleon(210gp) runes, but also envenom(130gp), desintegrate(80gp), soulfire(210gp) and paralyze(700gp) runes.'})
keywordHandler:addKeyword({'wands'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell wand of vortex(free), magic lightwand(500gp), dragonbreath(1k), plague(5k), cosmic energy(10k) and inferno(15k).'})
keywordHandler:addKeyword({'rods'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell snakebite(free), moonlight(1k), volcanic(5k), quarmire(10k) and tempest rods(15k).'})
keywordHandler:addKeyword({'fluids'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell mana(55gp) and life(60gp) fluids.'})

shopModule:addBuyableItem({'mana fluid', 'manafluid', 'mf'}, 	2006, 55, 	7, 	'mana fluid')
shopModule:addBuyableItem({'life fluid', 'lifefluid', 'lf'}, 	2006, 60, 	10,	'life fluid')

shopModule:addBuyableItem({'blank rune', 'br'}, 		2260, 10, 		'blank rune')

shopModule:addBuyableItem({'light magic missile', 'lmm'}, 	2287, 40, 10,		'light magic missile rune')
shopModule:addBuyableItem({'heavy magic missile', 'hmm'}, 	2311, 125, 10,		'heavy magic missile rune')
shopModule:addBuyableItem({'sudden death', 'sd'}, 		2268, 325, 3, 		'sudden death rune')

shopModule:addBuyableItem({'great fireball', 'gfb'}, 		2304, 180, 4, 		'great fireball rune')
shopModule:addBuyableItem({'fireball'}, 			2302, 95,  5,		'fire ball')
shopModule:addBuyableItem({'explosion', 'explo'}, 		2313, 250, 6, 		'explosion rune')

shopModule:addBuyableItem({'fire field', 'ff'}, 		2301, 85,  3,		'fire field rune')
shopModule:addBuyableItem({'energy field', 'ef'}, 		2277, 115, 3, 		'energy field')
shopModule:addBuyableItem({'poison field', 'pf'}, 		2285, 65,  3,		'poison field')
shopModule:addBuyableItem({'destroy field', 'df'}, 		2261, 45,  3, 		'destroy field')

shopModule:addBuyableItem({'fire wall', 'fw'}, 			2303, 245, 4,		'fire wall rune')
shopModule:addBuyableItem({'energy wall', 'ew'}, 		2279, 340, 4,		'energy wall rune')
shopModule:addBuyableItem({'poison wall', 'pw'}, 		2289, 210, 4,		'poison wall rune')
shopModule:addBuyableItem({'magic wall', 'mw'}, 		2289, 350, 3,		'magic wall rune')

shopModule:addBuyableItem({'fire bomb'}, 			2305, 235, 2,		'fire bomb rune')
shopModule:addBuyableItem({'poison bomb'}, 			2286, 170, 2,		'poison bomb rune')
shopModule:addBuyableItem({'energy bomb'}, 			2262, 325, 2,		'energy bomb rune')

shopModule:addBuyableItem({'antidote'}, 			2266, 65, 1, 		'antidote rune')
shopModule:addBuyableItem({'intense healing', 'ih'}, 		2265, 95, 1,		'intense healing rune')
shopModule:addBuyableItem({'ultimate healing', 'uh'}, 		2273, 175, 1, 		'ultimate healing rune')

shopModule:addBuyableItem({'convince creature'}, 		2290, 80, 1,		'convince creature rune')
shopModule:addBuyableItem({'chameleon rune'}, 			2291, 210, 1, 		'chameleon rune')
shopModule:addBuyableItem({'soulfire'}, 			2308, 210, 3, 		'soulfire rune')
shopModule:addBuyableItem({'envenom'}, 				2292, 130, 1, 		'envenom rune')
shopModule:addBuyableItem({'paralyze'}, 			2278, 700, 1, 		'paralyze rune')


shopModule:addBuyableItem({'spell book'}, 			2217, 150, 		'spell book')

shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 			2187, 15000, 	'wand of inferno')
shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 		2189, 10000,  	'wand of cosmic energy')
shopModule:addBuyableItem({'wand of plague', 'plague'}, 			2188, 5000, 	'wand of plague')
shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 		2191, 1000, 	'wand of dragonbreath')
shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 			2190, 0, 	'wand of vortex')
shopModule:addBuyableItem({'magic light wand', 'magic lightwand'}, 		2163, 500, 	'magic light wand')

shopModule:addBuyableItem({'tempest rod', 'tempest'}, 				2183, 15000, 	'tempest rod')
shopModule:addBuyableItem({'quagmire rod', 'quagmire'}, 			2181, 10000,  	'quagmire rod')
shopModule:addBuyableItem({'volcanic rod', 'volcanic'}, 			2185, 5000, 	'volcanic rod')
shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 			2186, 1000, 	'moonlight rod')
shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 			2182, 0, 	'snakebite rod')

local node = keywordHandler:addKeyword({'flask'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to return all your empty vials for 5 gold coins each?'})
	node:addChildKeyword({'yes'}, returnVials, {itemid = 2006, charges = 0, cost = 5})
	node:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Allright then.'})

local node = keywordHandler:addKeyword({'vial'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to return all your empty vials for 5 gold coins each?'})
	node:addChildKeyword({'yes'}, returnVials, {itemid = 2006, charges = 0, cost = 5})
	node:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Allright then.'})

npcHandler:addModule(FocusModule:new())

Secondly I made a npc which sells paladin ammunitions and also sells Assassin Stars to people which are lvl 80 and get full assassin addon. Remember, you also needs to get my addon npc if you want the full assassin addon working for it, else you need to change getPlayerStorageValue(cid,120001) and getPlayerStorageValue(cid,120002).

Add to Cindy.xml:
Code:
<npc name="Cindy" script="data/npc/scripts/distance.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="137" head="114" body="0" legs="11" feet="0" addons="3" corpse="2212"/>
	<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Greetings |PLAYERNAME|. I sell bows, spears, arrows, bolts and other ammunitions. I also buy crossbows(150gp) and bows(130gp)." />
<parameter key="shop_sellable" value="crossbow,2455,150;bow,2456,130" />
<parameter key="shop_buyable" value="throwing knife2410,25;royal spear,7378,15;crossbow,2455,500;bow,2456,400;spear,2389,10;piercing bolt,7363,4;power bolt,2547,6;bolt,2543,3;onyx arrow,7365,5;sniper arrow,7364,3;arrow,2544,2;throwing star,2399,42" />
</parameters>
</npc>

And add to Distance.lua:
Code:
local CONST_ASSASSIN_STAR_COST = 45
local CONST_ASSASSIN_STAR_LEVEL = 80
local CONST_ASSASSIN_STAR_ITEMID = 7368

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


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

local count = 1

function assassinStarCallback(cid, message, keywords, parameters)
    if(cid ~= npcHandler.focus) then
        return false
    end
    if(not(getPlayerStorageValue(cid,120001) == 1 and getPlayerStorageValue(cid,120002) == 1)) then
        npcHandler:say('I only sell assassin stars to more experienced people.')
        keywordHandler:reset()
    elseif(getPlayerLevel(cid) < CONST_ASSASSIN_STAR_LEVEL) then
        npcHandler:say('Your level is too low.')
        keywordHandler:reset()
    else
        count = ShopModule:getCount(message)
        npcHandler:say('I see that you are experienced enough. Do you want to buy ' .. count .. ' for ' .. count*CONST_ASSASSIN_STAR_COST .. ' gold coins?')
    end
    return true
end

function buyAssassinStarCallback(cid, message, keywords, parameters)
    if(cid ~= npcHandler.focus) then
        return false
    end
    
    if(doPlayerBuyItem(cid, CONST_ASSASSIN_STAR_ITEMID, count, count*CONST_ASSASSIN_STAR_COST) == LUA_NO_ERROR) then
        npcHandler:say('Here you are.')
    else
        npcHandler:say('You cannot afford that.')
    end
    keywordHandler:reset()
    return true
end

local node = keywordHandler:addKeyword({'assassin'}, assassinStarCallback)
node:addChildKeyword({'yes'}, buyAssassinStarCallback)
node:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Then what do you want?', reset = true})

local keywordModule = KeywordModule:new()
npcHandler:addModule(keywordModule)

keywordModule:addKeyword({'bows'}, 'I sell bows(400gp) and crossbows(500gp).')
keywordModule:addKeyword({'spears'}, 'I sell royal spears(15gp) and normal spears(10gp).')
keywordModule:addKeyword({'arrows'}, 'I sell arrows(2gp), sniper arrows(3gp) and onyx arrows(5gp).')
keywordModule:addKeyword({'bolts'}, 'I sell bolts(3gp), piercing bolts(4gp) and power bolts(6gp).')
keywordModule:addKeyword({'other'}, 'I sell throwing stars(42gp) and throwing knifes(25gp). And for very experienced players I sell assassin stars(45gp).')

npcHandler:addModule(FocusModule:new())

So now I would introduce you my addon npc. Lots of guys has made a bug in the nobleman addon which you need to pay 150k for to get one of the two addons and I fixed that. I already fixed some other addon, but I doesn't remember which one. I also edite the real items you need for the pirate addon. So here is the script.

Add to Jimmy.xml:
Code:
<npc name="Jimmy" script="data/npc/scripts/addon.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="145" head="114" body="114" legs="0" feet="114" addons="3" corpse="2212"/>

<parameters>
<parameter key="message_greet" value="Greetings |PLAYERNAME|. Will you help me? If you do, I'll reward you with nice addons! Just say 'addons' or 'help' if you don't know what to do." />
    <parameter key="module_keywords" value="1" />
    <parameter key="keywords" value="addons;help" />
    <parameter key="keyword_reply1" value="I can give you the first or the second addon for different outfits. They are Citizen, Hunter, Knight, Mage, Barbarian, Druid, Nobleman, Oriental, Summoner, Warrior, Wizard, Assassin, Beggar, Pirate and Shaman addons." />
    <parameter key="keyword_reply2" value="If you want get an addon just say the name of it, like sniper gloves. For more information visit: http://tibia.erig.net/Quests#Addons_Quests" />
</parameters>
</npc>

And add to addon.lua:
Code:
--------------------------------------------------------------------------------------------
------------------------------------ Advanced Addon NPC ------------------------------------
--------------------- Script made by teh_pwnage and bugfixes by Sentielo -------------------
--------------- Special thanks to: mokerhamer, Xidaozu and Jiddo, deaths'life --------------
------------------------------- Thanks also to everyone else -------------------------------
------------------------------ NPC based on TFS 0.2.4 --------------------------------------
--------------------------------------------------------------------------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	if(npcHandler.focus ~= cid) then
		return false
	end

		addon_need_premium = 'Sorry, you need a premium account to get addons.'
		addon_have_already = 'Sorry, you already have this addon.'
		addon_have_not_items = 'Sorry, you don\'t have these items.'
		addon_give = 'Here you are.'
		player_gold = getPlayerItemCount(cid,2148)
		player_plat = getPlayerItemCount(cid,2152)*100
		player_crys = getPlayerItemCount(cid,2160)*10000
		player_money = player_gold + player_plat + player_crys
		
		if msgcontains(msg, 'addons') then
			selfSay('I can give you Citizen, Hunter, Knight, Mage, Nobleman, Summoner, Warrior, Barbarian, Druid, Wizard, Oriental, Pirate, Assassin, Beggar, Shaman and Norseman addons.')
		elseif msgcontains(msg, 'help') then
			selfSay('To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.')
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first citizen addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5878) >= 100 then
					selfSay('Did you bring me 100 minotaur leathers?')
					talk_state = 1
				else
					selfSay('I need 100 minotaur leather, to give you the first citizen addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 1 then
			talk_state = 0
			if getPlayerItemCount(cid,5878) >= 100 then
				addon = getPlayerStorageValue(cid,10001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5878,100) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 128, 1)
						doPlayerAddOutfit(cid, 136, 1)
						setPlayerStorageValue(cid,10001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second citizen addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
					selfSay('Did you bring me 100 chicken feathers, 50 honeycombs and the legion helmet?')
					talk_state = 2
				else
					selfSay('I need 100 chicken feathers, 50 honeycombs and a legion helmet, to give you the second citizen addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 2 then
			talk_state = 0
			if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
				addon = getPlayerStorageValue(cid,10002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5890,100) == 0 and doPlayerTakeItem(cid,5902,50) == 0 and doPlayerTakeItem(cid,2480,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 128, 2)
						doPlayerAddOutfit(cid, 136, 2)
						setPlayerStorageValue(cid,10002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first hunter addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5947) >= 1 and getPlayerItemCount(cid,5876) >= 100 and getPlayerItemCount(cid,5948) >= 100 and getPlayerItemCount(cid,5891) >= 5 and getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5888) >= 1 and getPlayerItemCount(cid,5889) >= 1 then
					selfSay('Did you bring me the engraved crossbow, 100 lizard leathers, 100 red dragon leather, 5 enchanted chicken wings, royal steel, hell steel and draconian steel?')
					talk_state = 3
				else
					selfSay('I need a engraved crossbow, 100 lizard leathers, 100 red dragon leather, 5 enchanted chicken wings, royal steel, hell steel and draconian steel, to give you the first hunter addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 3 then
			talk_state = 0
			if getPlayerItemCount(cid,5947) >= 1 and getPlayerItemCount(cid,5876) >= 100 and getPlayerItemCount(cid,5948) >= 100 and getPlayerItemCount(cid,5891) >= 5 and getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5888) >= 1 and getPlayerItemCount(cid,5889) >= 1 then
				addon = getPlayerStorageValue(cid,20002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5947,1) == 0 and doPlayerTakeItem(cid,5876,100) == 0 and doPlayerTakeItem(cid,5948,100) == 0 and doPlayerTakeItem(cid,5891,5) == 0 and doPlayerTakeItem(cid,5887,1) == 0 and doPlayerTakeItem(cid,5888,1) == 0 and doPlayerTakeItem(cid,5889,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 129, 1)
						doPlayerAddOutfit(cid, 137, 1)
						setPlayerStorageValue(cid,20002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second hunter addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5875) >= 1 then
					selfSay('Did you bring me the sniper gloves?')
					talk_state = 4
				else
					selfSay('I need sniper gloves, to give you the second hunter addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 4 then
			talk_state = 0
			if getPlayerItemCount(cid,5875) >= 1 then
				addon = getPlayerStorageValue(cid,20001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5875,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 129, 2)
						doPlayerAddOutfit(cid, 137, 2)
						setPlayerStorageValue(cid,20001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first knight addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
					selfSay('Did you bring me the chunk of crude iron and 100 iron ores?')
					talk_state = 5
				else
					selfSay('I need a chunk of crude iron and 100 iron ores, to give you the first knight addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 5 then
			talk_state = 0
			if getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
				addon = getPlayerStorageValue(cid,30001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5892,1) == 0 and doPlayerTakeItem(cid,5880,100) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 131, 1)
						doPlayerAddOutfit(cid, 139, 1)
						setPlayerStorageValue(cid,30001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second knight addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5893) >= 100 and getPlayerItemCount(cid,5924) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5887) >= 1 then
					selfSay('Did you bring me 100 behemoth fangs, the damaged steel helmet, warrior\'s sweat, and royal steel?')
					talk_state = 6
				else
					selfSay('I need 100 behemoth fangs, a damaged steel helmet, warrior\'s sweat and royal steel, to give you the second knight addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 6 then
			talk_state = 0
			if getPlayerItemCount(cid,5893) >= 100 and getPlayerItemCount(cid,5924) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5887) >= 1 then
				addon = getPlayerStorageValue(cid,30002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5893,100) == 0 and doPlayerTakeItem(cid,5924,1) == 0 and doPlayerTakeItem(cid,5885,1) == 0 and doPlayerTakeItem(cid,5887,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 131, 2)
						doPlayerAddOutfit(cid, 139, 2)
						setPlayerStorageValue(cid,30002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first mage addon') then
			if isPremium(cid) then
				if getPlayerSex(cid) == 0 then
					if getPlayerItemCount(cid,5958) >= 1 then
						selfSay('Did you bring me a winning lotery ticket?')
						talk_state = 7
					else
						selfSay('I need a winning lotery ticket, to give you the first mage addon. Come back when you have it.')
						talk_state = 0
					end
				elseif getPlayerSex(cid) == 1 then
					if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
						selfSay('Did you bring me all the wands and rods, 10 magic sulphors, 20 ankhs and a soul stone?')
						talk_state = 7
					else
						selfSay('I need all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone, to give you the first mage addon. Come back when you have it.')
						talk_state = 0
					end
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 7 then
			talk_state = 0
			if getPlayerSex(cid) == 0 then
				if getPlayerItemCount(cid,5958) >= 1 then
					addon = getPlayerStorageValue(cid,40001)
					if addon == -1 then
						if doPlayerTakeItem(cid,5958,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 141, 1)
							setPlayerStorageValue(cid,40001,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			elseif getPlayerSex(cid) == 1 then
				if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
					addon = getPlayerStorageValue(cid,40001)
					if addon == -1 then
						if doPlayerTakeItem(cid,2181,1) == 0 and doPlayerTakeItem(cid,2182,1) == 0 and doPlayerTakeItem(cid,2183,1) == 0 and doPlayerTakeItem(cid,2185,1) == 0 and doPlayerTakeItem(cid,2186,1) == 0 and doPlayerTakeItem(cid,2187,1) == 0 and doPlayerTakeItem(cid,2188,1) == 0 and doPlayerTakeItem(cid,2189,1) == 0 and doPlayerTakeItem(cid,2190,1) == 0 and doPlayerTakeItem(cid,2191,1) == 0 and doPlayerTakeItem(cid,5904,10) == 0 and doPlayerTakeItem(cid,2193,20) == 0 and doPlayerTakeItem(cid,5809,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 130, 1)
							setPlayerStorageValue(cid,40001,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second mage addon') then
			if isPremium(cid) then
				if getPlayerSex(cid) == 0 then
					if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
						selfSay('Did you bring me 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts?')
						talk_state = 8
					else
						selfSay('I need 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts, to give you the second mage addon. Come back when you have it.')
						talk_state = 0
					end
				elseif getPlayerSex(cid) == 1 then
					if getPlayerItemCount(cid,5903) >= 1 then
						selfSay('Did you bring me the ferumbras hat?')
						talk_state = 8
					else
						selfSay('I need a ferumbras hat to give you the second mage addon. Come back when you have it.')
						talk_state = 0
					end
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 8 then
			talk_state = 0
			if getPlayerSex(cid) == 0 then
				if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
					addon = getPlayerStorageValue(cid,40002)
					if addon == -1 then
						if doPlayerTakeItem(cid,5894,70) and doPlayerTakeItem(cid,5911,20) and doPlayerTakeItem(cid,5883,40) and doPlayerTakeItem(cid,5922,35) and doPlayerTakeItem(cid,5886,10) and doPlayerTakeItem(cid,5881,60) and doPlayerTakeItem(cid,5882,40) and doPlayerTakeItem(cid,5904,15) and doPlayerTakeItem(cid,5905,30) then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 141, 2)
							setPlayerStorageValue(cid,40002,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			elseif getPlayerSex(cid) == 1 then
				if getPlayerItemCount(cid,5903) >= 1 then
					addon = getPlayerStorageValue(cid,40002)
					if addon == -1 then
						if doPlayerTakeItem(cid,5903,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 130, 2)
							setPlayerStorageValue(cid,40002,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first summoner addon') then
			if isPremium(cid) then
				if getPlayerSex(cid) == 1 then
					if getPlayerItemCount(cid,5958) >= 1 then
						selfSay('Did you bring me a winning lotery ticket?')
						talk_state = 9
					else
						selfSay('I need a winning lotery ticket, to give you the first summoner addon. Come back when you have it.')
						talk_state = 0
					end
				elseif getPlayerSex(cid) == 0 then
					if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
						selfSay('Did you bring me all the wands and rods, 10 magic sulphors, 20 ankhs and a soul stone?')
						talk_state = 9
					else
						selfSay('I need all kind of wands and rods, 10 magic sulphurs, 20 ankhs and a soul stone, to give you the first summoner addon. Come back when you have it.')
						talk_state = 0
					end
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 9 then
			talk_state = 0
			if getPlayerSex(cid) == 1 then
				if getPlayerItemCount(cid,5958) >= 1 then
					addon = getPlayerStorageValue(cid,50001)
					if addon == -1 then
						if doPlayerTakeItem(cid,5958,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 133, 1)
							setPlayerStorageValue(cid,50001,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			elseif getPlayerSex(cid) == 0 then
				if getPlayerItemCount(cid,2181) >= 1 and getPlayerItemCount(cid,2182) >= 1 and getPlayerItemCount(cid,2183) >= 1 and getPlayerItemCount(cid,2185) >= 1 and getPlayerItemCount(cid,2186) >= 1 and getPlayerItemCount(cid,2187) >= 1 and getPlayerItemCount(cid,2188) >= 1 and getPlayerItemCount(cid,2189) >= 1 and getPlayerItemCount(cid,2190) >= 1 and getPlayerItemCount(cid,2191) >= 1 and getPlayerItemCount(cid,5904) >= 10 and getPlayerItemCount(cid,2193) >= 20 and getPlayerItemCount(cid,5809) >= 1 then
					addon = getPlayerStorageValue(cid,50001)
					if addon == -1 then
						if doPlayerTakeItem(cid,2181,1) == 0 and doPlayerTakeItem(cid,2182,1) == 0 and doPlayerTakeItem(cid,2183,1) == 0 and doPlayerTakeItem(cid,2185,1) == 0 and doPlayerTakeItem(cid,2186,1) == 0 and doPlayerTakeItem(cid,2187,1) == 0 and doPlayerTakeItem(cid,2188,1) == 0 and doPlayerTakeItem(cid,2189,1) == 0 and doPlayerTakeItem(cid,2190,1) == 0 and doPlayerTakeItem(cid,2191,1) == 0 and doPlayerTakeItem(cid,5904,10) == 0 and doPlayerTakeItem(cid,2193,20) == 0 and doPlayerTakeItem(cid,5809,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 138, 1)
							setPlayerStorageValue(cid,50001,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second summoner addon') then
			if isPremium(cid) then
				if getPlayerSex(cid) == 1 then
					if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
						selfSay('Did you bring me 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts?')
						talk_state = 10
					else
						selfSay('I need 70 bat wings, 20 red pieces of cloth, 40 ape fur, 35 holy orchid, 10 spools of spider silk yarn, 60 lizard scales, 40 red dragon scales, 15 magic sulphurs and 30 vampire dusts, to give you the second summoner addon. Come back when you have it.')
						talk_state = 0
					end
				elseif getPlayerSex(cid) == 0 then
					if getPlayerItemCount(cid,5903) >= 1 then
						selfSay('Did you bring me the Ferumbrass\' hat?')
						talk_state = 10
					else
						selfSay('I need the famous Ferumbrass\' hat, to give you the second summoner addon. Come back when you have it.')
						talk_state = 0
					end
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 10 then
			talk_state = 0
			if getPlayerSex(cid) == 1 then
				if getPlayerItemCount(cid,5894) >= 70 and getPlayerItemCount(cid,5911) >= 20 and getPlayerItemCount(cid,5883) >= 40 and getPlayerItemCount(cid,5922) >= 35 and getPlayerItemCount(cid,5886) >= 10 and getPlayerItemCount(cid,5881) >= 60 and getPlayerItemCount(cid,5882) >= 40 and getPlayerItemCount(cid,5904) >= 15 and getPlayerItemCount(cid,5905) >= 30 then
					addon = getPlayerStorageValue(cid,50002)
					if addon == -1 then
						if doPlayerTakeItem(cid,5894,70) and doPlayerTakeItem(cid,5911,20) and doPlayerTakeItem(cid,5883,40) and doPlayerTakeItem(cid,5922,35) and doPlayerTakeItem(cid,5886,10) and doPlayerTakeItem(cid,5881,60) and doPlayerTakeItem(cid,5882,40) and doPlayerTakeItem(cid,5904,15) and doPlayerTakeItem(cid,5905,30) then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 133, 2)
							setPlayerStorageValue(cid,50002,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			elseif getPlayerSex(cid) == 0 then
				if getPlayerItemCount(cid,5903) >= 1 then
					addon = getPlayerStorageValue(cid,50002)
					if addon == -1 then
						if doPlayerTakeItem(cid,5903,1) == 0 then
							selfSay(addon_give)
							doPlayerAddOutfit(cid, 138, 2)
							setPlayerStorageValue(cid,50002,1)
						end
					else
						selfSay(addon_have_already)
					end
				else
					selfSay(addon_have_not_items)
				end
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first barbarian addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
					selfSay('Did you bring me the fighting spirit, the warrior\'s sweat, 50 red pieces of cloth, 50 green pieces of cloth and 10 spider silk yarns?')
					talk_state = 11
				else
					selfSay('I need fighting spirit, warrior\'s sweat, 50 red pieces of cloth, 50 green pieces of cloth and 10 spider silk yarns, to give you the first barbarian addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 11 then
			talk_state = 0
			if getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5885) >= 1 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
				addon = getPlayerStorageValue(cid,60001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5884,1) == 0 and doPlayerTakeItem(cid,5885,1) == 0 and doPlayerTakeItem(cid,5911,50) == 0 and doPlayerTakeItem(cid,5910,50) == 0 and doPlayerTakeItem(cid,5886,10) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 143, 2)
						doPlayerAddOutfit(cid, 147, 2)
						setPlayerStorageValue(cid,60001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second barbarian addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5880) >= 100 and getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5893) >= 50 and getPlayerItemCount(cid,5876) >= 50 then
					selfSay('Did you bring me 100 iron ore, 1 chunk of crude iron, 50 behemoth fangs and 50 lizard leathers?')
					talk_state = 12
				else
					selfSay('I need 100 iron ore, 1 chunk of crude iron, 50 behemoth fangs and 50 lizard leathers, to give you the second barbarian addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 12 then
			talk_state = 0
			if getPlayerItemCount(cid,5880) >= 100 and getPlayerItemCount(cid,5892) >= 1 and getPlayerItemCount(cid,5893) >= 50 and getPlayerItemCount(cid,5876) >= 50 then
				addon = getPlayerStorageValue(cid,60002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5880,100) == 0 and doPlayerTakeItem(cid,5892,1) == 0 and doPlayerTakeItem(cid,5893,50) == 0 and doPlayerTakeItem(cid,5876,50) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 143, 1)
						doPlayerAddOutfit(cid, 147, 1)
						setPlayerStorageValue(cid,60002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first druid addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5897) >= 50 and getPlayerItemCount(cid,5896) >= 50 then
					selfSay('Did you bring me 50 wolf paws and 50 bear paws?')
					talk_state = 13
				else
					selfSay('I need 50 wolf paws and 50 bear paws, to give you the first druid addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 13 then
			talk_state = 0
			if getPlayerItemCount(cid,5897) >= 50 and getPlayerItemCount(cid,5896) >= 50 then
				addon = getPlayerStorageValue(cid,70001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5897,50) == 0 and doPlayerTakeItem(cid,5896,50) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 144, 1)
						doPlayerAddOutfit(cid, 148, 1)
						setPlayerStorageValue(cid,70001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second druid addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5937) >= 1 and getPlayerItemCount(cid,5938) >= 1 and getPlayerItemCount(cid,5906) >= 100 and getPlayerItemCount(cid,5940) >= 1 then
					selfSay('Did you bring me 100 demon dusts, ceiron his wolf tooth chain, the water from the hydra cave and the botanist container?')
					talk_state = 14
				else
					selfSay('I need 100 demon dusts, ceiron his wolf tooth chain, the water from the hydra cave and the botanist container to give you the second druid addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 14 then
			talk_state = 0
			if getPlayerItemCount(cid,5906) >= 100 then
				addon = getPlayerStorageValue(cid,70002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5906,100) == 0 and doPlayerTakeItem(cid,5938,1) >=1 and doPlayerTakeItem(cid,5906,100) >=100 and doPlayerTakeItem(cid,5940,1) >=1 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 144, 2)
						doPlayerAddOutfit(cid, 148, 2)
						setPlayerStorageValue(cid,70002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
	elseif msgcontains(msg, 'first nobleman addon') then
			if isPremium(cid) then
				if player_money >= 150000 then
					selfSay('Did you bring me 150000 gold coins?')
					talk_state = 15
				else
					selfSay('I need 150000 gold coins, to give you the first nobleman addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 15 then
			talk_state = 0
			if player_money >= 150000 then
				addon = getPlayerStorageValue(cid,80001)
				if addon == -1 then
					if doPlayerRemoveMoney(cid,150000) then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 132, 1)
						doPlayerAddOutfit(cid, 140, 1)
						setPlayerStorageValue(cid,80001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second nobleman addon') then
			if isPremium(cid) then
				if player_money >= 150000 then
					selfSay('Did you bring me 150000 gold coins?')
					talk_state = 16
				else
					selfSay('I need 150000 gold coins, to give you the second nobleman addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 16 then
			talk_state = 0
			if player_money >= 150000 then
				addon = getPlayerStorageValue(cid,80002)
				if addon == -1 then
					if doPlayerRemoveMoney(cid,150000) then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 132, 2)
						doPlayerAddOutfit(cid, 140, 2)
						setPlayerStorageValue(cid,80002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first oriental addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5945) >= 1 then
					selfSay('Did you bring me the mermaid comb?')
					talk_state = 17
				else
					selfSay('I need a mermaid comb, to give you the first oriental addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 17 then
			talk_state = 0
			if getPlayerItemCount(cid,5945) >= 1 then
				addon = getPlayerStorageValue(cid,90001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5945,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 146, 1)
						doPlayerAddOutfit(cid, 150, 1)
						setPlayerStorageValue(cid,90001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second oriental addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5883) >= 100 and getPlayerItemCount(cid,5895) >= 100 and getPlayerItemCount(cid,5891) >= 2 and getPlayerItemCount(cid,5912) >= 100 then
					selfSay('Did you bring me 100 ape furs, 100 fish fins, 2 enchanted chicken wings and 100 blue pieces of cloth?')
					talk_state = 18
				else
					selfSay('I need 100 ape furs, 100 fish fins, 2 enchanted chicken wings and 100 blue pieces of cloth, to give you the second oriental addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 18 then
			talk_state = 0
			if getPlayerItemCount(cid,5883) >= 100 and getPlayerItemCount(cid,5895) >= 100 and getPlayerItemCount(cid,5891) >= 2 and getPlayerItemCount(cid,5912) >= 100 then
				addon = getPlayerStorageValue(cid,90002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5883,100) == 0 and doPlayerTakeItem(cid,5895,100) == 0 and doPlayerTakeItem(cid,5891,2) == 0 and doPlayerTakeItem(cid,5912,100) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 146, 2)
						doPlayerAddOutfit(cid, 150, 2)
						setPlayerStorageValue(cid,90002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first warrior addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5925) >= 100 and getPlayerItemCount(cid,5899) >= 100 and getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5919) >= 1 then
					selfSay('Did you bring me 100 hardened bones, 100 turtle shells, fighting spirit and a dragon claw?')
					talk_state = 19
				else
					selfSay('I need 100 hardened bones, 100 turtle shells, fighting spirit and a dragon claw, to give you the first warrior addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 19 then
			talk_state = 0
			if getPlayerItemCount(cid,5925) >= 100 and getPlayerItemCount(cid,5899) >= 100 and getPlayerItemCount(cid,5884) >= 1 and getPlayerItemCount(cid,5919) >= 1 then
				addon = getPlayerStorageValue(cid,100001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5925,100) == 0 and doPlayerTakeItem(cid,5899,100) == 0 and doPlayerTakeItem(cid,5884,1) == 0 and doPlayerTakeItem(cid,5919,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 134, 1)
						doPlayerAddOutfit(cid, 142, 1)
						setPlayerStorageValue(cid,100001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second warrior addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
					selfSay('Did you bring me 100 iron ores and royal steel?')
					talk_state = 20
				else
					selfSay('I need 100 iron ores and royal steel, to give you the second warrior addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 20 then
			talk_state = 0
			if getPlayerItemCount(cid,5887) >= 1 and getPlayerItemCount(cid,5880) >= 100 then
				addon = getPlayerStorageValue(cid,100002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5887,1) == 0 and doPlayerTakeItem(cid,5880,100) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 134, 2)
						doPlayerAddOutfit(cid, 142, 2)
						setPlayerStorageValue(cid,100002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first wizard addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,2488) >= 1 and getPlayerItemCount(cid,2123) >= 1 and getPlayerItemCount(cid,2492) >= 1 and getPlayerItemCount(cid,2536) >= 1 then
					selfSay('Did you bring me a medusa shield, a dragon scale mail, a ring of the sky and crown legs?')
					talk_state = 21
				else
					selfSay('I need a medusa shield, a dragon scale mail, a ring od the sky and crown legs, to give you the first wizard addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 21 then
			talk_state = 0
			if getPlayerItemCount(cid,2488) >= 1 and getPlayerItemCount(cid,2123) >= 1 and getPlayerItemCount(cid,2492) >= 1 and getPlayerItemCount(cid,2536) >= 1 then
				addon = getPlayerStorageValue(cid,110001)
				if addon == -1 then
					if doPlayerTakeItem(cid,2488,1) == 0 and doPlayerTakeItem(cid,2123,1) == 0 and doPlayerTakeItem(cid,2492,1) == 0 and doPlayerTakeItem(cid,2536,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 145, 2)
						doPlayerAddOutfit(cid, 149, 2)
						setPlayerStorageValue(cid,110001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second wizard addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5922) >= 50 and getPlayerStorageValue(cid,110001) then
					selfSay('Did you bring me 50 holy orchids?')
					talk_state = 22
				else
					selfSay('I need 50 holy orchids and you must have a skull mask or a snake tiara, to give you the second wizard addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 22 then
			talk_state = 0
			if getPlayerItemCount(cid,5922) >= 50 then
				addon = getPlayerStorageValue(cid,110002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5922,50) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 145, 1)
						doPlayerAddOutfit(cid, 149, 1)
						setPlayerStorageValue(cid,110002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first assassin addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5898) >= 30 and getPlayerItemCount(cid,5882) >= 10 and getPlayerItemCount(cid,5881) >= 30 and getPlayerItemCount(cid,5895) >= 20 and getPlayerItemCount(cid,5905) >= 20 and getPlayerItemCount(cid,5906) >= 10 and getPlayerItemCount(cid,5885) >= 1 then
					selfSay('Did you bring me 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat?')
					talk_state = 23
				else
					selfSay('I need 30 beholder eyes, 10 red dragon scales, 30 lizard scales, 20 fish fins, 20 vampire dusts, 10 demon dusts and Warrior\'s sweat, to give you the first assassin addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 23 then
			talk_state = 0
			if getPlayerItemCount(cid,5898) >= 30 and getPlayerItemCount(cid,5882) >= 10 and getPlayerItemCount(cid,5881) >= 30 and getPlayerItemCount(cid,5895) >= 20 and getPlayerItemCount(cid,5905) >= 20 and getPlayerItemCount(cid,5906) >= 10 and getPlayerItemCount(cid,5885) >= 1 then
				addon = getPlayerStorageValue(cid,120001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5898,30) == 0 and doPlayerTakeItem(cid,5882,10) == 0 and doPlayerTakeItem(cid,5881,30) == 0 and doPlayerTakeItem(cid,5895,20) == 0 and doPlayerTakeItem(cid,5905,20) == 0 and doPlayerTakeItem(cid,5906,10) == 0 and doPlayerTakeItem(cid,5885,1) then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 152, 1)
						doPlayerAddOutfit(cid, 156, 1)
						setPlayerStorageValue(cid,120001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second assassin addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5909) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5912) >= 50 and getPlayerItemCount(cid,5913) >= 50 and getPlayerItemCount(cid,5914) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
					selfSay('Did you bring me 50 blue piece of cloth, 50 green piece of cloth, 50 red piece of cloth, 50 brown piece of cloth, 50 yellow piece of cloth, 50 white piece of cloth and 10 spider silk yarns?')
					talk_state = 24
				else
					selfSay('I need 50 blue piece of cloth, 50 green piece of cloth, 50 red piece of cloth, 50 brown piece of cloth, 50 yellow piece of cloth, 50 white piece of cloth and 10 spider silk yarns, to give you the second assassin addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 24 then
			talk_state = 0
			if getPlayerItemCount(cid,5909) >= 50 and getPlayerItemCount(cid,5910) >= 50 and getPlayerItemCount(cid,5911) >= 50 and getPlayerItemCount(cid,5912) >= 50 and getPlayerItemCount(cid,5913) >= 50 and getPlayerItemCount(cid,5914) >= 50 and getPlayerItemCount(cid,5886) >= 10 then
				addon = getPlayerStorageValue(cid,120002)
				if addon == -1 then
					if doPlayerTakeItem(cid,5909,50) == 0 and doPlayerTakeItem(cid,5910,50) == 0 and doPlayerTakeItem(cid,5911,50) == 0 and doPlayerTakeItem(cid,5912,50) == 0 and doPlayerTakeItem(cid,5913,50) == 0 and doPlayerTakeItem(cid,5914,50) == 0 and doPlayerTakeItem(cid,5886,10) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 152, 2)
						doPlayerAddOutfit(cid, 156, 2)
						setPlayerStorageValue(cid,120002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first beggar addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
					selfSay('Did you bring me 100 ape furs and 20000 gold coins?')
					talk_state = 25
				else
					selfSay('I need 100 ape furs and 20000 gold coins, to give you the first beggar addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 25 then
			talk_state = 0
			if getPlayerItemCount(cid,5883) >= 100 and player_money >= 20000 then
				addon = getPlayerStorageValue(cid,130001)
				if addon == -1 then
					if doPlayerTakeItem(cid,5883,100) == 0 and doPlayerRemoveMoney(cid,20000) then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 153, 1)
						doPlayerAddOutfit(cid, 157, 1)
						setPlayerStorageValue(cid,130001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second beggar addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,6107) >= 1 then
					selfSay('Did you bring me Simon\'s favourite staff?')
					talk_state = 26
				else
					selfSay('I need Simon\'s favourite staff, to give you the second beggar addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 26 then
			talk_state = 0
			if getPlayerItemCount(cid,6107) >= 1 then
				addon = getPlayerStorageValue(cid,130002)
				if addon == -1 then
					if doPlayerTakeItem(cid,6107,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 153, 2)
						doPlayerAddOutfit(cid, 157, 2)
						setPlayerStorageValue(cid,130002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first pirate addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,6126) >= 100 and getPlayerItemCount(cid,6097) >= 100 and getPlayerItemCount(cid,6098) >= 100 then
					selfSay('Did you bring me 100 eye patches, 100 peg legs and 100 hooks?')
					talk_state = 27
				else
					selfSay('I need 100 eye patches, 100 peg legs and 100 hooks, to give you the first pirate addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 27 then
			talk_state = 0
			if getPlayerItemCount(cid,6126) >= 100 and getPlayerItemCount(cid,6097) >= 100 and getPlayerItemCount(cid,6098) >= 100 then
				addon = getPlayerStorageValue(cid,140001)
				if addon == -1 then
					if doPlayerTakeItem(cid,6126,100) == 0 and doPlayerTakeItem(cid,6097,100) == 0 and doPlayerTakeItem(cid,6098,100) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 151, 1)
						doPlayerAddOutfit(cid, 155, 1)
						setPlayerStorageValue(cid,140001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second pirate addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,6101) >= 1 and getPlayerItemCount(cid,6102) >= 1 and getPlayerItemCount(cid,6099) >= 1 and getPlayerItemCount(cid,6100) >= 1 then
					selfSay('Did you bring me Ron the Ripper\'s Sabre, the Deadeye Devious\' Eye Patch, the Brutus Bloodbeard\'s hat and the Lethal Lissy\'s Shirt?')
					talk_state = 28
				else
					selfSay('I need Ron the Ripper\'s Sabre, the Deadeye Devious\' Eye Patch, the Brutus Bloodbeard\'s hat and the Lethal Lissy\'s Shirt to give you the second pirate addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 28 then
			talk_state = 0
			if getPlayerItemCount(cid,6101) >= 1 and getPlayerItemCount(cid,6102) >= 1 and getPlayerItemCount(cid,6099) >= 1 and getPlayerItemCount(cid,6100) >= 1 then
				addon = getPlayerStorageValue(cid,140002)
				if addon == -1 then
					if doPlayerTakeItem(cid,6101,1) == 0 and doPlayerTakeItem(cid,6102,1) == 0 and doPlayerTakeItem(cid,6099,1) == 0 and doPlayerTakeItem(cid,6100,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 151, 2)
						doPlayerAddOutfit(cid, 155, 2)
						setPlayerStorageValue(cid,140002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first shaman addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,3955) >= 5 and getPlayerItemCount(cid,5015) >= 1 then
					selfSay('Did you bring me 5 dworc vodoo dolls and a mandrake?')
					talk_state = 29
				else
					selfSay('I need 5 dworc vodoo dolls and a mandrake, to give you the first shaman addon. Come back when you have it.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 29 then
			talk_state = 0
			if getPlayerItemCount(cid,3955) >= 5 and getPlayerItemCount(cid,5015) >= 1 then
				addon = getPlayerStorageValue(cid,150001)
				if addon == -1 then
					if doPlayerTakeItem(cid,3955,5) == 0 and doPlayerTakeItem(cid,5015,1) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 154, 1)
						doPlayerAddOutfit(cid, 158, 1)
						setPlayerStorageValue(cid,150001,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second shaman addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,3966) >= 5 and getPlayerItemCount(cid,3967) >= 5 then
					selfSay('Did you bring me 5 banana staffs and 5 tribal masks?')
					talk_state = 30
				else
					selfSay('I need 5 banana staffs and 5 tribal masks, to give you the second shaman addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 30 then
			talk_state = 0
			if getPlayerItemCount(cid,3966) >= 5 and getPlayerItemCount(cid,3967) >= 5 then
				addon = getPlayerStorageValue(cid,150002)
				if addon == -1 then
					if doPlayerTakeItem(cid,3966,5) == 0 and doPlayerTakeItem(cid,3967,5) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 154, 2)
						doPlayerAddOutfit(cid, 158, 2)
						setPlayerStorageValue(cid,150002,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'first norseman addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,7290) >= 5 then
					selfSay('Excellent, Did you bring me 5 shard?')
					talk_state = 31
				else
					selfSay('I need 5 shard, to give you the first norseman addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 31 then
			talk_state = 0
			if getPlayerItemCount(cid,7290) >= 5 then
				addon = getPlayerStorageValue(cid,150003)
				if addon == -1 then
					if doPlayerTakeItem(cid,7290,5) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 251, 1)
						doPlayerAddOutfit(cid, 252, 1)
						setPlayerStorageValue(cid,150003,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ addon ------------------------------------------------
		elseif msgcontains(msg, 'second norseman addon') then
			if isPremium(cid) then
				if getPlayerItemCount(cid,7290) >= 10 then
					selfSay('Did you bring me 10 shard?')
					talk_state = 32
				else
					selfSay('I need 10 shard, to give you the second norseman addon. Come back when you have them.')
					talk_state = 0
				end
			else
				selfSay(addon_need_premium)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------
		elseif msgcontains(msg, 'yes') and talk_state == 32 then
			talk_state = 0
			if getPlayerItemCount(cid,7290) >= 10 then
				addon = getPlayerStorageValue(cid,150004)
				if addon == -1 then
					if doPlayerTakeItem(cid,7290,10) == 0 then
						selfSay(addon_give)
						doPlayerAddOutfit(cid, 251, 2)
						doPlayerAddOutfit(cid, 252, 2)
						setPlayerStorageValue(cid,150004,1)
					end
				else
					selfSay(addon_have_already)
				end
			else
				selfSay(addon_have_not_items)
			end
------------------------------------------------ confirm no ------------------------------------------------
		elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 34) then
			selfSay('Ok than.')
			talk_state = 0
		end
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
P.s. I know I didn't made the scripts, but I bugfixed them so don't spamm me with that!

Now my food npc. I only needed to change the foodprices and remove/add some new foods, so it wasn't really much to do.

Add to Michael.xml:
Code:
<npc name="Michael" script="data/npc/scripts/food.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="128" head="20" body="100" legs="50" feet="99" corpse="2212" addons="3"/>
	<parameters>
		<parameter key="module_shop" value="1" />
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell brown bread(4gp), ham(8gp), meat(5gp), cheese(6gp) and cookies(5gp)!" />
		<parameter key="shop_buyable" value="brown bread,2691,4;ham,2671,8;;meat,2666,5;;cheese,2696,6;;cookie,2687,5;;" />
	</parameters>
</npc>

And add to food.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end

npcHandler:addModule(FocusModule:new())

I used to many words (lol), so I need to make a new reply.
 
Last edited:
Here is my npc which sells and buys differnt diamonds and I also add talons, because you can sell it to a npc, but not the same as other diamonds.

Add to Little Joe:
Code:
<npc name="Little Joe" script="data/npc/scripts/diamond.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="154" head="0" body="77" legs="1" feet="0" addons="1" corpse="2212"/>
	<parameters>
<parameter key="module_shop" value="1" />
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy diamonds and rings! I also sell diamonds and rings! Say buy diamonds or sell diamonds for more information. Else you can say buy rings or sell rings." />

	</parameters>
</npc>

In the past the furniture shops in the OTs were always the same prices for everything you which to buy. You couldn't can buy everything you wish aswell, so I made a script.

Add to Kate.xml:
Code:
<npc name="Kate" script="data/npc/scripts/furniture.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="142" head="114" body="0" legs="95" feet="114" corpse="2212" addons="3"/>
	<parameters>
		<parameter key="module_shop" value="1" />
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell chairs, tables, plants, containers, pillows, tapestries and more. Everything for 100 gold pieces." />
		<parameter key="shop_buyable" value="wooden chair,3901,15;sofa chair,3902,55;red cushioned chair,3903,40;green cushioned chair,3904,40;tusk chair,3905,25;ivory chair,3906,25;big table,3909,30;square table,3910,25;round table,3911,25;small table,3912,20;stone table,3913,30;tusk table,3914,25;bamboo table,3919,25;potted flower,3928,5;indoor plant,3929,8;christmas tree,3931,50;large trunk,3938,10;drawer,3921,18;dresser,3932,25;locker,3934,30;trough,3935,7;box,3915,10;birdcage,3918,50;harp,3917,50;piano,3926,200;globe,3927,50;pendelum clock,3933,75;table lamp,3937,35;blue tapestry,1872,25;green tapestry,1860,25;orange tapestry,1866,25;pink tapestry,1857,25;red tapestry,1869,25;white tapestry,1880,25;yellow tapestry,1863,25;small purple pillow,1678,20;small green pillow,1679,20;small red pillow,1680,20;small blue pillow,1681,20;small orange pillow,1683,20;small turquiose pillow,1684,20;small white pillow,1684,20;heart pillow,1685,30;purple pillow,1678,25;green pillow,1679,25;red pillow,1680,25;blue pillow,1681,orange pillow,1682,25;turqoise pillow,25;white pillow,1684,25;round blue pillow,1690,25;round red pillow,1691,25;round purple pillow,1692,25;round turquiose pillow,1693,25;coal basin,3908,25" />
	</parameters>
</npc>

And add to furniture.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!

keywordHandler:addKeyword({'chairs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell wooden(15gp), sofa(55gp), red cushioned(40gp), green cushioned(40gp), tusk(25gp) and ivory(25gp) chairs.'})
keywordHandler:addKeyword({'tables'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell big(30gp), square(25gp), round(25gp), small(20gp), stone(30gp), tusk(25gp), bamboo(25gp) tables.'})
keywordHandler:addKeyword({'flowers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell potter flowers(5gp) and indoor plants(8), also christmas trees(50gp).'})
keywordHandler:addKeyword({'containers'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell large trunks(10gp), boxes(10gp), drawers(18gp), dressers(25gp), lockers(30gp) and troughs(7gp).'})
keywordHandler:addKeyword({'more'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell birdcages(50gp), coal basins(25gp), harps(50gp), pianos(200gp), globes(50gp), pendelum clocks(75gp) and table lamps(35gp).'})

keywordHandler:addKeyword({'pillows'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell small pillows(20gp), round pillows(25gp), square pillows(25gp) and tapestries(25gp). I also sell heart pillows(30gp).'})
keywordHandler:addKeyword({'tapestries'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell blue, green, orange, pink, red, white and yellow tapestries for 25 gp each.'})
keywordHandler:addKeyword({'small'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell small blue, red, green, purple, orange, turquoise and white pillows for 20 gp each.'})
keywordHandler:addKeyword({'round'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell round purple, red, blue and turquoise pillows for 25gp each.'})
keywordHandler:addKeyword({'sqaure'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell purple, green, red, blue, orange, turqoise and white pillows for 25gp each.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Now my weaponshop based on the djins (equipments, rods and wants) and on the new 8.1 npc rachid. I will add other EQs later, when I got time to.

Add to Marry.xml:
Code:
<npc name="Marry" script="data/npc/scripts/loot.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="147" head="114" body="94" legs="19" feet="0" addons="3" corpse="2212"/>

<parameters>
<parameter key="module_shop" value="1" />
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, axes, clubs, armors, helmets, legs, boots, shields, wands and rods" />
<parameter key="shop_sellable" value="dragon hammer,2398,2000;giant sword,2393,17000;knight axe,2430,2000;poison dagger,2411,50;scimitar,2419,150;serpent sword,2409,900;skull staff,2436,6000;dragon lance,2414,9000;fire axe,2432,8000;fire sword,2392,4000;war hammer,2391,1200;spike sword,2383,1000;ice rapier,2396,1000;broad sword,2413,500;obsidian lance,2425,500;dragon slayer,7402,15000;war axe,2454,9000;amber staff,7426,8000;sapphire hammer,7437,2000;lunar staff,7424,5000;diamond sceptre,7387,3000;dragonbone staff,7430,3000;beastslayer axe,3962,1500;brutetamer's staff,7379,1500;wyvern fang,7408,1500;daramanian waraxe,2440,1000;furry club,27432,1000;crystal sword,7449,600;taurus mace,7425,500;silver dagger,2402,500;mammoth whopper,7381,300;daramanian mace,2439,110;heavy machete,2442,90;crown armor,2487,12000;blue robe,2656,10000;noble armor,2486,900;dark armor,2489,400;knight armor,2476,5000;dragon scale mail,2492,40000;golden armor,2466,20000;mammoth fur cape,7463,6000;leopard armor,3968,1000;pirate shirt,605,500;royal helmet,2498,30000;crusader helmet,2497,6000;crown helmet,2491,2500;dark helmet,2490,250;mystic turban,2663,150;strange helmet,2479,500;warrior helmet,2475,5000;skull helmet,5741,40000;beholder helmet,3972,7500;devil helmet,2462,1000;pirate hat,6096,1000;ragnir helmet,7462,400;krimhorn helmet,7461,200;crown legs,2488,12000;boots of haste,2195,30000;knight legs,2477,5000;steel boots,2645,30000;pirate boots,5462,2000;fur boots,7457,2000;crocodile boots,3982,1000;pirate knee breeches,5918,200;phoenix shield,2539,16000;crown shield,5519,8000;dragon shield,2516,4000;guardian shield,2515,2000;beholder shield,2518,1200;ancient shield,2532,900;black shield,2529,800;tower shield,2528,8000;vampire shield,2534,15000;demon shield,2520,30000;medusa shield,2536,9000;castle shield,2535,5000;scarab shield,2540,2000;dark shield,2521,400;tortoise shield,6131,150;bone shield,2541,80;magic lightwand,2162,30;wand of vortex,2190,100;wand of dragonbreath,2191,200;wand of plague,2188,1000;wand of cosmic energy,2189,2000;wand of inferno,2187,3000;tempest rod,2183,3000;moonlight rod,2186,200;snakebite rod,2182,100;volcanic rod,2185,1000;quarmire rod,2181,2000;war hammer,2391,10000;spike sword,2383,8000;noble armor,2486,8000;beholder shield,2518,7000;ice rapier,2396,5000;serpent sword,2409,6000;dark armor,2489,1500;dark helmet,2490,1000;ancient shield,2532,5000;" />"
</parameters>

</npc>

And add to loot.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy dragon hammers(2k), skull staffs(6k), war hammers(1.2k), dragonbone staffs(3k) and daramanian maces(110gp). I also buy amber staffs(8k), sapphire hammers(2k), brutetamer\s staff(1.5k), furry clubs(1k), taurus maces(500gp), lunar staffs(5k), mammoth whoppers(300gp) and diamond sceptres(3k).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy knight axes(2k), dragon lances(9k), fira axes (8k), obsidian lances(500gp), war axes(9k) and daramanian waraxes (1k). I also buy beastslayer axe(1.5k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant swords (17k), poison daggers (50gp), scimiteras (150gp), serpent sword (900gp), fire sword (4k), spike swords(1k), ice rapiers(1k), broad swords(500gp), dragon slayers(15k), wyvern fang(1.5k), silver dagger(500gp) and heavy machetes(90gp).'})
keywordHandler:addKeyword({'wands'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy magic lightwands(30gp), wand of vortexes(100gp), wand of dragonbreaths(200gp), wand of plagues(1k), wand of cosmic energys(2k) and wand if infernoes(3k).'})
keywordHandler:addKeyword({'rods'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy snakebite rods(100gp), moonlight rods(200gp), volcanic rods(1k), quarmire rods(2k) and tempest rods(3k).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy boots of hastes(30k), steel boots(30k), pirate boots(2k) and crocodile boots(1k). I also buy fur boots(2k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown armors(12k), blue robes(10k), noble armors(900gp), dark armors(400gp), knight armors(5k), dragon scale mails(40k), golden armors(20k) and pirate scirts(500gp). I also buy mammoth fur capes(6k), leopard armors(1k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown legs(12k), knight legs(5k) and pirate knee breeches(200gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy phoenix shields(16k), crown shields(8k), dragon shields(4k), guardian shields(2k), beholder shields(1.2k), ancient shields(900gp), black shields, tower shields(8k), vampire shields(15k), demon shields(30k), medusa shields(9k), castle shields(5k), scarab shields(2k), dark shields(400gp), tortoise shields(150gp) and bone shields(80gp).'})
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal(30k), crusader(6k), crown(2.5k), dark(250gp), strange(500gp), warrior(5k), skull(40k), beholder(7.5k), devil(1k), ragnir(400gp) and krimhorn(200gp). I also buy mystic turbans(150gp) and pirate hats(1k).'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Here is my seller npc which sells bags and backpacks in all differnt collours and sells aols for 5cc.

Add to Thomas.xml:
Code:
<npc name="Thomas" script="data/npc/scripts/seller.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="134" head="76" body="81" legs="76" feet="19" addons="3" corpse="2212"/>
	<parameters>
		<parameter key="module_shop" value="1" />
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell ropes (50gp), shovels (20gp), backpacks(20gp), fishing rods (150gp), amulet of loss (50k), and torches (2gp), machete (30gp). I buy vials (5gp)." />
		<parameter key="shop_buyable" value="vial,2006,5;flask,2006,5" />
		<parameter key="shop_buyable" value="shovel,2554,20;brown bag,1987,5;green bag,1991,5;yellow bag,1992,5;red bag,1993,5;purple bag,1994,5;blue bag,1995,5;grey bag,1996,5;golden bag,1997,5;seastar bag,5950,5;jungle bag,3939,5;pirate bag,5927,5;brown backpack,1988,20;green backpack,1998,20;yellow backpack,1999,20;red backpack,2000,20;purple backpack,2001,20;blue backpack,2002,20;grey backpack,2003,20;golden backpack,2004,20;seastar backpack,5949,20;jungle backpack,3940,20;pirate backpack,5926,20;fishing rod,2580,150;torch,2050,2;rope,2120,50;amulet of loss,2173,50000;machete,2420,30" />
	<parameter key="message_farewell" value="Farewell |PLAYERNAME|!" />
	</parameters>
</npc>

And add to seller.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end

keywordHandler:addKeyword({'backpacks'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell brown, green, yellow, red, purple, blue, grey and golden backpacks for 20 gp each. I also seastar backpacks, jungle backpacks and pirate backpacks for 20 gp each.'})
keywordHandler:addKeyword({'bag'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell brown, green, yellow, red, purple, blue, grey and golden bags for 5 gp each. I also seastar bags, jungle bags and pirate bags for 5 gp each.'})

npcHandler:addModule(FocusModule:new())



Finally I would like to share my "Sweaty cyclops" with you. It is the same as other sweaty cyclopses, but I edited the lottery ticket to the script. You need 100 manafluids and got 10% change to get the winning lottery ticket.

Add to A Sweaty Cyclops.xml:
Code:
<?xml version="1.0"?>
<npc name="A Sweaty Cyclops" script="data/npc/scripts/sweaty.lua" access="3" lookdir="2" autowalk="25">
  <mana now="800" max="800" />
  <health now="200" max="200" />
  <look type="22" head="0" body="0" legs="0" feet="0" />
  <parameters>
    <parameter key="message_greet" value="Hello |PLAYERNAME|. I can forge you royal steel from crown armors, hell steel from devil helmets, draconian steel from dragon shields, crude iron from giant swords and infernal bolts from soul orbs. I can also trade 100 manafluids for a lottery ticket." />    
  </parameters>
</npc>

And add to sweaty.lua:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    if(npcHandler.focus ~= cid) then
        return false
    end

    -- use the real conversation? (true/false)
    real = false
    
    if real == true then
        tradeMsg = 'Me can make good item from item me need. Me make uth\'kean, za\'ralator, uth\'lokr, uth\'prta and nasty lil\' bolts.'
        crownMsg = 'Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil\' one want to trade?'
        devilMsg = 'Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil\' one want to trade?'
        dragoMsg = 'Firy steel it is. Need green ones\' breath to melt. Or red even better. Me can make from shield. Lil\' one want to trade?'
        giantMsg = 'Good iron is. Me friends use it much for fight. Me can make from weapon. Lil\' one want to trade?'
        souloMsg = 'Uh. Me can make some nasty lil\' bolt from soul orbs. Lil\' one want to trade all?'
	ticketMsg = 'Uh. Me can make some ticket from 100 manafluids. Lil\' one want to trade all?'
        hasNoMsg = 'Lil\' one no have item I want.'
        noMsg = 'Lil\' one no want item?'
    else
        tradeMsg = 'I can forge you royal steel from crown armors, hell steel from devil helmets, draconian steel from dragon shields, crude iron from giant swords and infernal bolts from soul orbs. I can also change 100 manafluids for a lottery ticket.'
        crownMsg = 'Do you want to trade a crown armor for royal steel?'
        devilMsg = 'Do you want to trade a devil helmet for hell steel?'
        dragoMsg = 'Do you want to trade a dragon shield for draconian steel?'
        giantMsg = 'Do you want to trade a giant sword for crude iron?'
        souloMsg = 'Do you want to trade a soul orb for 2 infernal bolts?'
	ticketMsg = 'Do you want to trade 100 manafluids for a lottery ticket?'
        hasNoMsg = 'Come back when you have more!'

        noMsg = 'Ok than.'
    end
        if msgcontains(msg, 'items') or msgcontains(msg, 'item') or msgcontains(msg, 'forge') then
            selfSay(tradeMsg)
        elseif msgcontains(msg, 'royal steel') or msgcontains(msg, 'royal') or msgcontains(msg, 'crown') or msgcontains(msg, 'crown armor') or msgcontains(msg, 'uth\'kean') then
            selfSay(crownMsg)
            talk_state = 1
        elseif msgcontains(msg, 'hell steel') or msgcontains(msg, 'hell') or msgcontains(msg, 'devil') or msgcontains(msg, 'devil helmet') or msgcontains(msg, 'za\'ralator') then
            selfSay(devilMsg)
            talk_state = 2
        elseif msgcontains(msg, 'draconian steel') or msgcontains(msg, 'draconian') or msgcontains(msg, 'dragon') or msgcontains(msg, 'dragon shield') or msgcontains(msg, 'uth\'lokr') then
            selfSay(dragoMsg)
            talk_state = 3
        elseif msgcontains(msg, 'crude iron') or msgcontains(msg, 'crude') or msgcontains(msg, 'giant') or msgcontains(msg, 'gs') or msgcontains(msg, 'giant sword') or msgcontains(msg, 'uth\'prta') then
            selfSay(giantMsg)
            talk_state = 4
        elseif msgcontains(msg, 'infernal') or msgcontains(msg, 'infernal bolt') or msgcontains(msg, 'infernal bolts') or msgcontains(msg, 'soul') or msgcontains(msg, 'soul orb') or msgcontains(msg, 'soul orbs') or msgcontains(msg, 'nasty lil\' bolt') then
            selfSay(souloMsg)
            talk_state = 5
	elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'manafluids') or msgcontains(msg, 'mana fluid') or msgcontains(msg, 'mana fluids') or msgcontains(msg, 'ticket') or msgcontains(msg, 'lottery ticket') or msgcontains(msg, 'lottery') then
            selfSay(ticketMsg)
            talk_state = 6
------------------------------------------------ confirm yes ------------------------------------------------
        elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,2487) >= 1 then
                if doPlayerTakeItem(cid,2487,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,5887,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 2 then
            if getPlayerItemCount(cid,2462) >= 1 then
                if doPlayerTakeItem(cid,2462,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,5888,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 3 then
            if getPlayerItemCount(cid,2516) >= 1 then
                if doPlayerTakeItem(cid,2516,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,5889,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 4 then
            if getPlayerItemCount(cid,2393) >= 1 then
                if doPlayerTakeItem(cid,2393,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,5892,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 5 then
            if getPlayerItemCount(cid,5944) >= 1 then
                if doPlayerTakeItem(cid,5944,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6529,2)
                end
            else
                selfSay(hasNoMsg)
            end
    elseif msgcontains(msg, 'yes') and talk_state == 6 then
        if getPlayerItemCount(cid,2006) >= 100 then
            if doPlayerTakeItem(cid,2006,100) == 0 then
                selfSay('Here you are.')
                if(math.random(1,10) == 1) then
                    doPlayerAddItem(cid,5958,1)
                else
                    doPlayerAddItem(cid,5956,1)
                end
            else
                selfSay(hasNoMsg)
            end
        else
            selfSay(hasNoMsg)
        end
        talk_state = 0
------------------------------------------------ confirm no ------------------------------------------------
        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 6) then
            selfSay(noMsg)
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

When I have made some new scripts I will release them as soon as possible it is. If you found bugs please report them to me! The credits are in most part of times by me and Jiddo and the addon npc of teh_owner.

Yours,
Sentielo
 
Last edited:
Haha, honestly, I didn't know you could do like that:

Code:
   if real == true then
        tradeMsg = 'Me can make good item from item me need. Me make uth\'kean, za\'ralator, uth\'lokr, uth\'prta and nasty lil\' bolts.'
        crownMsg = 'Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil\' one want to trade?'
        devilMsg = 'Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil\' one want to trade?'
        dragoMsg = 'Firy steel it is. Need green ones\' breath to melt. Or red even better. Me can make from shield. Lil\' one want to trade?'
        giantMsg = 'Good iron is. Me friends use it much for fight. Me can make from weapon. Lil\' one want to trade?'
        souloMsg = 'Uh. Me can make some nasty lil\' bolt from soul orbs. Lil\' one want to trade all?'
    ticketMsg = 'Uh. Me can make some ticket from 100 manafluids. Lil\' one want to trade all?'
        hasNoMsg = 'Lil\' one no have item I want.'
        noMsg = 'Lil\' one no want item?'
    else
        tradeMsg = 'I can forge you royal steel from crown armors, hell steel from devil helmets, draconian steel from dragon shields, crude iron from giant swords and infernal bolts from soul orbs. I can also change 100 manafluids for a lottery ticket.'
        crownMsg = 'Do you want to trade a crown armor for royal steel?'
        devilMsg = 'Do you want to trade a devil helmet for hell steel?'
        dragoMsg = 'Do you want to trade a dragon shield for draconian steel?'
        giantMsg = 'Do you want to trade a giant sword for crude iron?'
        souloMsg = 'Do you want to trade a soul orb for 2 infernal bolts?'
    ticketMsg = 'Do you want to trade 100 manafluids for a lottery ticket?'        hasNoMsg = 'Come back when you have more!'

Good to know ^^ Thanks for releasing those scripts here, we really need more scripts, so that noone has to go to fans.net -.-
 
@ Empty.
I didn't know it too. It just took the script and added a 10% of getting the winning lottery ticket. I didn't changed anything else of the script, but NP.

@J3ff.
Thanks. I fixed it with Jiddo (the maker of the npc system) and 90% of the credits goes to him.
 
It dosen't matter who made what part of the script, it's about giving credit to the right person.
 
But can i add this global.lua to my own global or can u tell me what i need to have out of global for addon system?
 
Sorry but none of the scripts are working here
i tryd addon system he will talk and taking the items from u but he dont give any addons:<
 
Can please somebody help me:< i got 8.1 server but he takes items and give no addons:S
 
There is small bug in runes.lua
when u want to buy magic wall then it sell u poison wall ;p just change id

2289 to 2293
 
Last edited:
I am making a rl tibia server and I will fix everything to 8.11 and make a new threat (this was for 8.00 not for 8.11).

@rx2royal, thx I will fix it on 8.11

yours,
sentielo

ps is it allowed if somebody tells me where to download a nice rl map?
 
i will search something ;p wait i will edit post

i have 8.0 but u can convert to 8.1


i found server 81 with rl map, but my avast found virus. Scan it, maybe avast is wrong... this server isn't my
[thread=3824]8.1 server with rl map.[/thread]
 
Last edited:
Back
Top