Ir para conteúdo

[Encerrado] [Encerrado] Ajuda sistema reward


Fjinst

Posts Recomendados

Olá a todos, possuo esse script aqui de reward system para TFS 0.3~0.4 no qual as vezes não funciona, gostaria de saber se podem me ajudar implementando uma maneira de funcionar sempre, no caso seria

 

 

###########

Adicionar:

Se o time (na party) derrotasse o boss, todos do time (que estejam na party) receberiam loot, porém, para o jogador do time(que esteja na party) receber loot precisa ser no minimo level 100, a distancia entre os jogadores da party tem que ser no maximo 30 sqms de distancia

#######################

 

Segue abaixo o script

 local config = {  ["[MvP] Goku"] = {  loot = {{7958,25,math.random(1,3)},{2353,25,1},{2672,100,math.random(1,100)},{2173,15,1},{9651,25,math.random(1,25)},{2152,100,1},{9813,10,1},{9812,10,1},{9811,10,1},{9028,10,1},{2160,25,1},{2152,100,1},{2152,100,1},{2152,50,math.random(1,3)},{2160,20,math.random(1,6)}},  message = "Congratulations for defeating [MvP] Goku, Your reward is now in depot",  effect = CONST_ME_SOUND_PURPLE,    use_stats = false,  chance_attr = {{'lifesteal',5,{3,7},{"melee","wand","dist"}},{'dodge',5,{1,5},{"armor"}}},  animatedText = {COLOR_BLUE,"YA!"},  SendToDepot = true,  BagId = 1999  },  ["Grunth"] = {  loot = {{2493,4,1},{2494,4,1},{2495,4,1},{2214,4,1},{5462,4,1},{8850,4,1},{8925,4,1},{7382,4,1},{2436,4,1},{8921,4,1},{6391,4,1},{2157,50,75},{2157,50,50},{2157,25,100}},  message = "Congratulation For Defeating Hypnos,Your Reward is now in bag",  effect = CONST_ME_SOUND_YELLOW,    use_stats = false,  chance_attr = {{'lifesteal',4,{3,7},{"melee","wand","dist"}},{'dodge',4,{1,5},{"armor"}}},  animatedText = {COLOR_MAYABLUE,"YA!"},  SendToDepot = false,  BagId = 2000  },  ["Training Monk"] = {  loot = {{2533,4,1},{7899,4,1},{7894,4,1},{2209,4,1},{7891,4,1},{8851,4,1},{8924,4,1},{7385,4,1},{2421,4,1},{8922,4,1},{2496,4,1},{2157,50,100},{2157,50,100},{2157,25,100}},  message = "Congratulation For Defeating Hades,Your Reward is now in depot",  effect = CONST_ME_FIREWORK_RED,    use_stats = false,  chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'dodge',3,{1,5},{"all"}}},  animatedText = {COLOR_RED,"YA!"},  SendToDepot = true,  BagId = 1988  },  ["Demon"] = {  loot = {{2542,4,1},{7902,4,1},{7897,4,1},{7896,4,1},{2124,4,1},{7892,4,1},{8852,4,1},{7455,4,1},{7420,4,1},{2445,4,1},{7424,4,1},{2157,50,100},{2157,50,100},{2157,50,100},{2157,25,100}},  message = "Congratulation For Defeating Devil,Your Reward is now in depot",  effect = CONST_ME_HEARTS,    use_stats = false,  chance_attr = {{'lifesteal',1,{3,7},{"melee","wand","dist"}},{'dodge',1,{1,5},{"armor"}}},  animatedText = {COLOR_PINK,"YA!"},  SendToDepot = true,  BagId = 1988  }  --[[  ["NameOfMonster"] = {  loot = {{itemid,chance,count},{itemid,chance,count}},  message = "Message produced when you kill the boss",  effect = "Effect when you kill boss",  use_stats = false -- if it is true then special attribute will be added  chance_attr = {{'attribute name',chance,{min,max},{applied weapons}},{'attribute name',chance,{min,max},{applied weapons}}},  animatedText = {Color of text,"Text produced"},  SendToDepot = true will send item to the depot, false will send item to player bag auto,  BagId = dont need explanation  }     ]]}--forgive this part V couldn't think of any better solutionfunction ItemInfo(array,item)  for i = 1,#array do  if(array[i] == "melee")then  if getItemInfo(item).weaponType == WEAPON_SWORD or getItemInfo(item).weaponType == WEAPON_CLUB or getItemInfo(item).weaponType == WEAPON_AXE then  return true  end  elseif(array[i] == "armor")then  if getItemInfo(item).armor ~= 0 and getItemInfo(item).wieldPosition ~= CONST_SLOT_NECKLACE then  return true  end  elseif(array[i] == "wand")then  if getItemInfo(item).weaponType == WEAPON_WAND then  return true  end  elseif(array[i] == "dist")then  if getItemInfo(item).weaponType == WEAPON_DIST and getItemInfo(item).ammoType ~= 0 then  return true  end  elseif(array[i] == "shield")then  if getItemInfo(item).weaponType == WEAPON_SHIELD and getItemInfo(item).defense ~= 0 then  return true  end    elseif(array[i] == "all")then  return true  end  end  return falseend--- info scanner End function onKill(cid, target, damage, flags,war)  if isPlayer(cid) and isMonster(target) then  local monster = config[getCreatureName(target)]  if monster then  local bag = doCreateItemEx(monster.BagId, 1)  for i = 1,#monster.loot do  if monster.loot[i][2] >= math.random(1,100) then -- random chance to get the item  local item = doAddContainerItem(bag, monster.loot[i][1],monster.loot[i][3])      if (monster.use_stats) then         for z = 1,#monster.chance_attr do           if(monster.chance_attr[z][2] >= math.random(1,100) and ItemInfo(monster.chance_attr[z][4], monster.loot[i][1]))then             doItemSetAttribute(item, monster.chance_attr[z][1], math.random(monster.chance_attr[z][3][1],monster.chance_attr[z][3][2])) -- add attribute           end         end       end  end  end  if(getContainerItem(bag, 0).uid > 0)then -- check if the container has items or not  doSendMagicEffect(getThingPos(cid), monster.effect)  doSendAnimatedText(getThingPos(cid), monster.animatedText[2],monster.animatedText[1])  if monster.SendToDepot then  doPlayerSendMailByName(getCreatureName(cid), bag, getPlayerTown(cid), "Admin") -- send to depot  else  doPlayerAddItemEx(cid, bag,true) -- send to bag  end  doPlayerSendTextMessage(cid, 25, monster.message)	  else  doPlayerSendTextMessage(cid, 25, "Better luck next time, you do not got reward.")  end  end  end  return trueend 

 

Editado por Fjinst
Link para o comentário
Compartilhar em outros sites

  • 4 months later...
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...