What's new

Actions [TFS] Mining

Status
Not open for further replies.

Thorge D

Advanced User
Joined
Jul 24, 2014
Messages
300
Reaction score
29
Autor: Rabbcio

Jest to m?j b. b. stary skrypt, dlatego mo?e by? jako? dziwnie napisany. [10.09.09]
Opis:
U?ywaj?c kilofa uderzamy w kamie?[ustawienie id w configu]...
Korzystaj?c z algorytmu "1-100+(liczba skilla/10)" losuje liczb?, je?eli liczba jest mniejsza ni? nasz skill losuje liczbe od 1-3(itemy).
Je?li wylosuje 1 wtedy daje gp: od 1-do ilo?ci skilla
Je?li wylosuje 2 wtedy losuje liczbe od 1-(200+liczba skilla/10) i gdy ta liczba jest mniejsza od naszego skilla dostajemy od 1 do (ilo?? skilla/10) platynek.
Je?li wylosuje 3 wtedy losuje liczbe od (1-400+liczba skilla/10) i gdy ta liczba jest mniejsza od naszego skilla wtedy daje od 1-(ilo?? skilla/20) crystal coin?w

Kod:
[LUA]function onUse(cid, item, fromPosition, itemEx, toPosition)
local item2 = {2148,2152,2160} --> jakie itemy maja leciec
local count = 1
local skaly = {1355} --> w jakie ska?y mo?e bi?

if isInArray(skaly, itemEx.itemid) == TRUE then
if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
local randomChance = math.random(1, table.maxn(item2))
if randomChance == 1 then
count = math.random(1, (1 + (getPlayerSkill(cid, SKILL_FISHING)))) --> jak wylosuje gp(item nr 1) to ile ma leciec
doPlayerAddItem(cid,item2[randomChance],count)
doPlayerSendTextMessage(cid,22,"Wydobyles "..count.." Gold.")
elseif randomChance == 2 then
if math.random(1, (200 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
count = math.random(1, (1 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) --> jak wylosuje platinum(item nr 2) to ile ma leciec
doPlayerSendTextMessage(cid,22,"Wydobyles "..count.." Platinum.")
doPlayerAddItem(cid,item2[randomChance],count)
else
doPlayerSendCancel(cid, "Nic nie wydobyles")
end
elseif randomChance == 3 then
if math.random(1, (400 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
count = math.random(1, (1 + (getPlayerSkill(cid, SKILL_FISHING) / 20))) --> jak wylosuje crystal(item nr 3) to ile ma leciec
doPlayerSendTextMessage(cid,22,"Wydobyles "..count.." Crystal.")
doPlayerAddItem(cid,item2[randomChance],count)
else
doPlayerSendCancel(cid, "Nic nie wydobyles")
end
end
else
doPlayerSendCancel(cid, "Nic nie wydobyles")
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
end
return true
end[/LUA]
zapisujemy to pod nazw? /.../tools/kilof.lua ,
a w actions.xml piszemy:
[XML]<action itemid="2553" event="script" value="tools/kilof.lua"/>[/XML]

Przy biciu skillujemy fishinga, mo?emy si? nieco pobawi? w cliencie i zmnieni? nazwe skilla i b?dzie mining, ale tego ju? nie opisze bo mo?ecie znale?? to na google.pl, je?li b?dzie co? niezrozumia?e prosz? tu pisa?.
 
Status
Not open for further replies.
Top