Sentielo
Advanced OT User
- Joined
- Feb 3, 2008
- Messages
- 2,388
- Reaction score
- 226
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:
So let's start with the scripts.
First of all I would like to introduce you my rune npc + vial.
Add to Frank.xml:
add to runes.lua:
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:
And add to Distance.lua:
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:
And add to addon.lua:
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:
And add to food.lua:
I used to many words (lol), so I need to make a new reply.
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())
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: