Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: Lua  |  size: 1.84 KB  |  hits: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. local outfits = {
  2.         [128] or [136] = {hp = 100, mp = 150, speed = 200}, --Citizen
  3.         [129] or [137] = {hp = 100, mp = 150, speed = 200}, --Hunter
  4.         [130] or [138] = {hp = 100, mp = 150, speed = 200}, --Mage
  5.         [131] or [139] = {hp = 100, mp = 150, speed = 200}, --Knight
  6.         [132] or [140] = {hp = 100, mp = 150, speed = 200}, --Nobleman
  7.         [133] or [141] = {hp = 100, mp = 150, speed = 200}, --Summoner
  8.         [134] or [142] = {hp = 100, mp = 150, speed = 200}, --Warrior
  9.         [143] or [147] = {hp = 100, mp = 150, speed = 200}, --Barbarian
  10.         [144] or [148] = {hp = 100, mp = 150, speed = 200}, --Druid
  11.         [145] or [149] = {hp = 100, mp = 150, speed = 200}, --Wizard
  12.         [146] or [150] = {hp = 100, mp = 150, speed = 200}, --Oriental
  13.         [151] or [155] = {hp = 100, mp = 150, speed = 200}, --Pirate
  14.         [152] or [156] = {hp = 100, mp = 150, speed = 200}, --Assassin
  15.         [153] or [157] = {hp = 100, mp = 150, speed = 200}, --Beggar
  16.         [154] or [158] = {hp = 100, mp = 150, speed = 200}, --Shaman
  17.         [251] or [252] = {hp = 100, mp = 150, speed = 200}, --Norseman
  18.         [268] or [269] = {hp = 100, mp = 150, speed = 200}, --Nightmare
  19. }      
  20.  
  21. function onOutfit(cid, old, current)
  22.         for k, v in pairs(outfits) do
  23.                 if doCreatureChangeOutfit(cid, current) and current.lookAddons == 3 and getCreatureOutfit(cid) ~= old and current.lookAddons == 3 then
  24.                         doChangeSpeed(cid, getCreatureBaseSpeed(cid))
  25.                         setCreatureMaxHealth(cid, -[current].v[1])
  26.                         setCreatureMaxMana(cid, -[current].v[2])
  27.                         setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+[current].v[1])
  28.                         setCreatureMaxMana(cid, getCreatureMaxMana(cid)+[current].v[2])
  29.                         doChangeSpeed(cid, getCreatureBaseSpeed(cid)+[current].v[3])
  30.                 elseif
  31.                         current.lookAddons ~= 3
  32.                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This outfit does not have both addons and therefore you have not received any bonus.")
  33.                 end
  34.         end
  35.         return true
  36. end