Kapitek
Prawie Gość
Dołączył: 25 Wrz 2007
Posty: 6
Przeczytał: 0 tematów
Pomógł: 1 raz Ostrzeżeń: 0/5
|
Wysłany: Nie 15:36, 11 Lis 2007 Temat postu: Ciekawe Skrypty |
|
|
Te skrypty które za chwile wam przedstawie NIE SĄ MOJE
Rosyjska Ruletka
Działanie: Po użyciu mamy prawdopodobieństwo 1 na 6 że padniemy (tak jak w rosyjskiej ruletce). Jeśli mamy farta dostajemy 100gp lub exp (nasz lvl razy 100, np.: lvl 25 dostanie 2500 expa).
Wchodzimy w ots/data/action/script i tworzymy plik o nazwie ruletka.lua i wklejamy do niego:
Kod: | function onUse(cid, item, frompos, item2, topos)
local hp = getPlayerHealth(cid)
local mana = getPlayerMana(cid)local level = getPlayerLevel(cid)
local ded = (hp) + (mana)
local ileexpa = (level * 100)
text = math.random(1, 6)
if text == 1 then
doPlayerAddItem(cid,2152,1)
doSendMagicEffect(topos, 1)
doSendAnimatedText(topos,'Masz farta!',137)
elseif text == 2 then
doPlayerAddItem(cid,2152,1)
doSendMagicEffect(topos, 1)
doSendAnimatedText(topos,'Masz farta!',137)
elseif text == 3 then
doPlayerAddExp(cid,ileexpa)
doSendMagicEffect(topos, 1)
doSendAnimatedText(topos,'Masz farta!',137)
elseif text == 4 then
doPlayerAddExp(cid,ileexpa)
doSendMagicEffect(topos, 1)
doSendAnimatedText(topos,'Masz farta!',137)
elseif text == 5 then
doPlayerAddExp(cid,ileexpa)
doSendMagicEffect(topos, 1)
doSendAnimatedText(topos,'Masz farta!',137)
elseif text == 6 then
doPlayerAddHealth(cid,-ded)
doSendMagicEffect(topos, 17)
doSendAnimatedText(topos,'Pech...!',180)
end
return 1
end |
Następnie dodajemy linijke do ots/data/action Actions.xml
Kod: | <action itemid="xxxx" script="ruletka.lua" /> |
xxxx to id itema jakim będzie ta ruleta. W grafikach tibii nie znalazłem rzeczy która mogła by tak wyglądać dlatego nie podałem konkretnego id.
Magiczna czapka Ferumbrasa
Działanie: Jak wiadomo Ferumbras jest magiem więc napewno zna jakieś sztuczki. Prościej mówiąc z jego kapelusza można wygągnąć jakieś zwierzątko (króliczek, papuga, skunks).
Wchodzimy w ots/data/action/script i tworzymy plik o nzawie ferumbras hat.lua i wklejamy:
Kod: | function onUse(cid, item, frompos, item2, topos)
pos = getPlayerPosition(cid)
summon = math.random(1, 3)
if summon == 1 then
doPlayerSay(cid,"WTF? Kroliczek? o.O",1)
doSummonCreature("Rabbit", pos)
doSendMagicEffect(topos,14)
doRemoveItem(item.uid,1)
elseif summon == 2 then
doPlayerSay(cid,"LOL! Papuga? W tej czapce?",1)
doSummonCreature("Parrot", pos)
doSendMagicEffect(topos,13)
doRemoveItem(item.uid,1)
elseif summon == 3 then
doPlayerSay(cid,"O fak! To cos tam siedzialo? ;/",1)
doSummonCreature("Skunk", pos)
doSendMagicEffect(topos,12)
doRemoveItem(item.uid,1)
end
return 1
end |
Następnie dodajemy linijke do ots/data/action Actions.xml
Kod: |
<action itemid="5903" script="ferumbras hat.lua" />
|
Wykłuwanie lodowego mamuta z lodowego bloku za pomocą Obisidian Knife.
Jednak nie tak łatwo jest go wykłóć. Gdy użyjmy obisidian knife na ice cube mamy szanse 1 do 3 że rozpoczniemy kłucie. Jeśli mamy farta nasz mamut zaczyna nabierać pierwszych kształtów. Możemy kolejny raz użyć i znowu szansa 1 do 3 że dalej będziemy kuli. Szanse na uzyskanie całej statuetki wynoszą około ~1,185 % Więc lodowy mamut będzie rarem na naszym ots. Istnieje też szansa (1 do 90) że przy pierwszym użyciu dostaniemy inną figurkę (ptak lub ryba). Gdy mamy pecha nasz lodowy blok rozpadnie sie i zostanie po nim tylko śnieg...
Zamieniamy w ots\data\actions\scripts plik ze skryptem obisidian_knife.lua lub go tworzymy i wklejamy do niego:
Kod: | function onUse(cid,item,frompos,item2,topos)
--obsidian knife code--
local DRAGON = 3104
local DRAGON_AFTER = 3105
local DL = 2881
local DL_AFTER = 2882
local BONEBEAST = 3031
local BONEBEAST_AFTER = 3032
local BEHEMOTH = 2931
local BEHEMOTH_AFTER = 2932
local LIZARD_SENTINEL = 4259
local LIZARD_SENTINEL_AFTER = 4260
local LIZARD_TEMPLAR = 4256
local LIZARD_TEMPLAR_AFTER = 4257
local LIZARD_SNAKECHARMER = 4262
local LIZARD_SNAKECHARMER_AFTER = 4263
local MINOTAUR = 2830
local MINOTAUR_AFTER = 2831
local MINOTAUR_ARCHER = 2871
local MINOTAUR_ARCHER_AFTER = 2872
local MINOTAUR_MAGE = 2866
local MINOTAUR_MAGE_AFTER = 2867
local MINOTAUR_GUARD = 2876
local MINOTAUR_GUARD_AFTER = 2877
local LIZARD_LEATHER = 5876
local DRAGON_LEATHER = 5877
local DL_LEATHER = 5948
local MINOTAUR_LEATHER = 5878
local BEHEMOTH_FANG = 5893
local BONEBEAST_BONE = 5925
local LIZARD_LEATHER_COUNT = 1
local DRAGON_LEATHER_COUNT = 1
local DL_LEATHER_COUNT = 1
local MINOTAUR_LEATHER_COUNT = 1
local BEHEMOTH_FANG_COUNT = 1
local BONEBEAST_BONE_COUNT = 1
local RAND_LIZARDS = math.random(1,7)
local RAND_BONEBEAST = math.random(1,9)
local RAND_DL = math.random(1,11)
local RAND_DRAGON = math.random(1,10)
local RAND_BEHEMOTH = math.random(1,12)
local RAND_MINOTAURS = math.random(1,8)
--start lizards--
if item2.itemid == LIZARD_SENTINEL then
doTransformItem(item2.uid,LIZARD_SENTINEL_AFTER)
if RAND_LIZARDS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,LIZARD_LEATHER,LIZARD_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
if item2.itemid == LIZARD_TEMPLAR then
doTransformItem(item2.uid,LIZARD_TEMPLAR_AFTER)
if RAND_LIZARDS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,LIZARD_LEATHER,LIZARD_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
if item2.itemid == LIZARD_SNAKECHARMER then
doTransformItem(item2.uid,LIZARD_SNAKECHARMER_AFTER)
if RAND_LIZARDS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,LIZARD_LEATHER,LIZARD_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--lizards end--
--start bonebeast--
if item2.itemid == BONEBEAST then
doTransformItem(item2.uid,BONEBEAST_AFTER)
if RAND_BONEBEAST == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,BONEBEAST_BONE,BONEBEAST_BONE_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--bonebeast end--
--start dl--
if item2.itemid == DL then
doTransformItem(item2.uid,DL_AFTER)
if RAND_DL == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,DL_LEATHER,DL_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--end dl--
--start dragon--
if item2.itemid == DRAGON then
doTransformItem(item2.uid, DRAGON_AFTER)
if RAND_DRAGON == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,DRAGON_LEATHER,DRAGON_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--end dragon--
--start behemoth--
if item2.itemid == BEHEMOTH then
doTransformItem(item2.uid,BEHEMOTH_AFTER)
if RAND_BEHEMOTH == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,BEHEMOTH_FANG,BEHEMOTH_FANG_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--end behemoth--
--start minotaurs--
if item2.itemid == MINOTAUR then
doTransformItem(item2.uid,MINOTAUR_AFTER)
if RAND_MINOTAURS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,MINOTAUR_LEATHER,MINOTAUR_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
if item2.itemid == MINOTAUR_ARCHER then
doTransformItem(item2.uid,MINOTAUR_ARCHER_AFTER)
if RAND_MINOTAURS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,MINOTAUR_LEATHER,MINOTAUR_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
if item2.itemid == MINOTAUR_MAGE then
doTransformItem(item2.uid,MINOTAUR_MAGE_AFTER)
if RAND_MINOTAURS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,MINOTAUR_LEATHER,MINOTAUR_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
if item2.itemid == MINOTAUR_GUARD then
doTransformItem(item2.uid,MINOTAUR_GUARD_AFTER)
if RAND_MINOTAURS == 1 then
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
doPlayerAddItem(cid,MINOTAUR_LEATHER,MINOTAUR_LEATHER_COUNT)
else
doSendMagicEffect(topos, CONST_ME_BLOCKHIT)
end
return 1
end
--end minotaurs--
-- Wykluwanie figurki mamuta zrobione przez Smoczek Leon --
-- Ice statue mammoth by Smoczek Leon --
rand = math.random(1, 3)
rand2 = math.random(1, 90)
lod = math.random(6715, 6718)
icepos = getThingPos(item2.uid)
if item2.itemid == 7441 then
if rand2 <= 30 then
doTransformItem(item2.uid,item2.itemid+1)
elseif rand2 == 31 then
doTransformItem(item2.uid,7447)
elseif rand2 == 32 then
doTransformItem(item2.uid,7448)
else
doRemoveItem(item2.uid,1)
doCreateItem(lod,1,icepos)
end
end
if item2.itemid == 7442 then
if rand == 1 then
doTransformItem(item2.uid,item2.itemid+2)
else
doRemoveItem(item2.uid,1)
doCreateItem(lod,1,icepos)
end
end
if item2.itemid == 7444 then
if rand == 1 then
doTransformItem(item2.uid,item2.itemid+1)
else
doRemoveItem(item2.uid,1)
doCreateItem(lod,1,icepos)
end
end
if item2.itemid == 7445 then
if rand == 1 then
doTransformItem(item2.uid,item2.itemid+1)
else
doRemoveItem(item2.uid,1)
doCreateItem(lod,1,icepos)
end
end
return 1
end |
Kolejnym skryptem jest odmrażanie zamarzniętych potworów.
Gdy użyjemy fire buga na ścianach o id 7291-7302 potwory w nich zamrożone odmrożą się i wyjdą z nich
Zmieniamy nasz plik w ots/data/actions/scripts fire_bug.lua na:
Kod: | function onUse(cid, item, frompos, item2, topos)
pos = getPlayerPosition(cid)
if math.random(0,10) > 8 then
doPlayerAddHealth(cid, -5)
doSendMagicEffect(frompos, 4)
doRemoveItem(item.uid, 1)
return 1
end
if item2.itemid == 5466 then
doTransformItem(item2.uid,5465)
doDecayItem(item2.uid)
else
end
if item2.itemid == 7291 then
doTransformItem(item2.uid,6731)
doSummonCreature('Demon',pos)
else
end
if item2.itemid == 7292 then
doTransformItem(item2.uid,6733)
doSummonCreature('Demon',pos)
else
end
if item2.itemid == 7293 then
doTransformItem(item2.uid,6731)
doSummonCreature('Mammoth',pos)
else
end
if item2.itemid == 7294 then
doTransformItem(item2.uid,6733)
doSummonCreature('Mammoth',pos)
else
end
if item2.itemid == 7295 then
doTransformItem(item2.uid,6731)
doSummonCreature('Dragon Lord',pos)
else
end
if item2.itemid == 7296 then
doTransformItem(item2.uid,6733)
doSummonCreature('Dragon Lord',pos)
else
end
if item2.itemid == 7297 then
doTransformItem(item2.uid,6731)
doSummonCreature('Behemoth',pos)
else
end
if item2.itemid == 7298 then
doTransformItem(item2.uid,6733)
doSummonCreature('Behemoth',pos)
else
end
if item2.itemid == 7299 then
doTransformItem(item2.uid,6731)
doSummonCreature('Plaguesmith',pos)
else
end
if item2.itemid == 7300 then
doTransformItem(item2.uid,6733)
doSummonCreature('Plaguesmith',pos)
else
end
if item2.itemid == 7301 then
doTransformItem(item2.uid,6731)
doSummonCreature('Ice Golem',pos)
else
end
if item2.itemid == 7302 then
doTransformItem(item2.uid,6733)
doSummonCreature('Ice Golem',pos)
else
end
return 1
end
|
Jeśli na swoim ots nie miałeś skryptów z fire bugiem i obsidian knifem dodaj też do actions.xml te linijki:
Kod: | <action itemid="5908" script="obsidian_knife.lua" />
<action itemid="5468" script="fire_bug.lua" /> |
Gdy użyjemy kawałka lodu o id 7289 na owocu (wiśnia, banan, truskawka, gruszka, winogron, jagoda) dostaniemy loda.
ots/data/actions/scrpits lody.lua
Kod: | function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 2679 then
doPlayerAddItem(cid,7372,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
elseif item2.itemid == 2676 then
doPlayerAddItem(cid,7373,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
elseif item2.itemid == 2680 then
doPlayerAddItem(cid,7374,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
elseif item2.itemid == 2681 then
doPlayerAddItem(cid,7375,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
elseif item2.itemid == 2673 then
doPlayerAddItem(cid,7376,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
elseif item2.itemid == 2677 then
doPlayerAddItem(cid,7377,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,22,"Lody mozesz zrobic z wisni, banana, truskawki, winogronu, gruszki lub jagod!")
end
return 1
end
|
A następnie dodajemy te linijki do actions.xml
Kod: | <action itemid="7289" script="lody.lua" /> |
I kolejny skrypt na łowienie nowych ryb
Zmieniamy plik fishing_rod.lua na następujący
Kod: | function onUse(cid, item, frompos, item2, topos)
-- itemid means that is a creature
ryby = math.random(1, 4)
if item2.itemid == 490 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 491 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 492 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 618 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 619 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 620 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 622 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 623 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 624 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 625 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 626 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 627 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 628 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
elseif item2.itemid == 4608 then
skill_level = getPlayerSkill(cid,6)
random_number = math.random(1,(100+skill_level/10))
doSendMagicEffect(topos,1)
if random_number<=skill_level then
if ryby == 1 then
doPlayerAddItem(cid,2667,1)
elseif ryby == 2 then
doPlayerAddItem(cid,2669,1)
elseif ryby == 3 then
doPlayerAddItem(cid,7158,1)
elseif ryby == 4 then
doPlayerAddItem(cid,7159,1)
end
end
doPlayerAddSkillTry(cid,6,1)
else
return 0
end
return 1
end
|
Aby można było jeść lody i nowe ryby należy zmienić też plik food.lua
Kod: | local text = ""
local nutrition = 0
local effect = 50
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2684 or item.itemid == 2362 or item.itemid == 2691 then
nutrition = 8
text = "Crunch."
elseif item.itemid == 2695 then
nutrition = 6
text = "Gulp."
elseif item.itemid == 2674 then
nutrition = 6
text = "Yum."
elseif item.itemid == 2787 then
nutrition = 9
text = "Munch."
elseif item.itemid == 2690 then
nutrition = 3
text = "Crunch."
elseif item.itemid == 2666 then
nutrition = 15
text = "Munch."
elseif item.itemid == 2667 then
nutrition = 12
text = "Munch."
elseif item.itemid == 2668 then
nutrition = 10
text = "Mmmm."
elseif item.itemid == 2689 then
nutrition = 10
text = "Crunch."
elseif item.itemid == 2669 then
nutrition = 17
text = "Munch."
elseif item.itemid == 2670 then
nutrition = 4
text = "Gulp."
elseif item.itemid == 2671 then
nutrition = 30
text = "Chomp."
elseif item.itemid == 2672 then
nutrition = 60
text = "Chomp."
elseif item.itemid == 2673 then
nutrition = 5
text = "Yum."
elseif item.itemid == 2675 then
nutrition = 13
text = "Yum."
elseif item.itemid == 2677 or item.itemid == 2679 then
nutrition = 1
text = "Yum."
elseif item.itemid == 2678 then
nutrition = 18
text = "Slurp."
elseif item.itemid == 2680 then
nutrition = 2
text = "Yum."
elseif item.itemid == 2687 then
nutrition = 2
text = "Crunch."
elseif item.itemid == 2681 then
nutrition = 9
text = "Yum."
elseif item.itemid == 2686 then
nutrition = 9
text = "Crunch."
elseif item.itemid == 2696 then
nutrition = 9
text = "Smack."
elseif item.itemid == 2682 then
nutrition = 20
text = "Yum."
elseif item.itemid == 2683 then
nutrition = 17
text = "Munch."
elseif item.itemid == 2685 then
nutrition = 6
text = "Munch."
elseif item.itemid == 2688 or item.itemid == 2793 then
nutrition = 9
text = "Munch."
elseif item.itemid == 2788 then
nutrition = 4
text = "Munch."
elseif item.itemid == 2789 then
nutrition = 22
text = "Munch."
elseif item.itemid == 2790 or item.itemid == 2791 then
nutrition = 30
text = "Munch."
elseif item.itemid == 2792 then
nutrition = 6
text = "Munch."
elseif item.itemid == 2794 then
nutrition = 3
text = "Munch."
elseif item.itemid == 2795 then
nutrition = 36
text = "Munch."
elseif item.itemid == 2796 then
nutrition = 5
text = "Munch."
elseif item.itemid == 6574 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 6394 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 6569 then
nutrition = 1
text = "Mmmm."
effect = 27
elseif item.itemid == 7158 then
nutrition = 17
text = "Mmmm."
elseif item.itemid == 7159 then
nutrition = 17
text = "Mmmm."
elseif item.itemid == 7372 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 7373 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 7374 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 7375 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 7376 then
nutrition = 4
text = "Mmmm."
elseif item.itemid == 7377 then
nutrition = 4
text = "Mmmm."
end
if (getPlayerFood(cid) + nutrition > 400) then
doPlayerSendCancel(cid,"You are full.")
else
doPlayerFeed(cid, nutrition * 4)
doPlayerSay(cid, text, 16)
doRemoveItem(item.uid, 1)
if effect < 31 then
doSendMagicEffect(getPlayerPosition(cid), 27)
end
end
return 1
end |
actions.xml
Kod: | <action itemid="7372" script="food.lua" />
<action itemid="7373" script="food.lua" />
<action itemid="7374" script="food.lua" />
<action itemid="7375" script="food.lua" />
<action itemid="7376" script="food.lua" />
<action itemid="7377" script="food.lua" />
<action itemid="7158" script="food.lua" />
<action itemid="7159" script="food.lua" /> |
Post został pochwalony 1 raz
|
|