What's new

Actions ToT Bag

Status
Not open for further replies.

Thorge D

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

Witam.

Gdy otworzymy specjalny worek mamy szanse na "Cukierek albo Psikus".

Skrypt ten jest dla os?b posiadaj?cych cho? troch? poj?cia o .lua (Poniewa?, dla os?b si? nie znaj?cych na tym ci??ko b?dzie cokolwiek zmieni?). Powiedzmy, ?e jest to tak jakby szablon do w?asnych Cukierk?w lub Psikus?w.
Ja w moim skrypcie umie?ci?em moim zdaniem najlepsze nagrody i psikusy.

U mnie jest 5 Nagr?d i 5 Psikus?w:

1. 2 Crystal Coins
2. 2 Crystal Coins + All Blessings
3. Losowa Runka z Tablicy..
4. 25 Cukierk?w
5. 500k Expa
6. Teleport na zadupie
7. Kick
8. Zmiana p?ci gracza
9. Wykrzykni?cie jakiego? tekstu przez gracza
10. Pusty worek

W actions/scripts/halloween/tot.lua

Wersja dla noob?w:
[LUA]-- ToT by Leon Zawodowiec --
-- Made for Halloween Update --

function onUse(cid, item, frompos, item2, topos)

local liczba = math.random(1,10)
-- no spoko expl dest fbomb hmm gfb sd mwal uh paral ava 5d 10d
runyyy_id = {2313, 2261, 2305, 2311, 2304, 2268, 2293, 2273, 2278, 2274, 2280, 2282}
x = {50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 1, 1}


if (liczba == 1) then
doPlayerAddItem(cid, 2160, 2, TRUE) -- 1. Treat - 2cc.
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins.")
return true

elseif (liczba == 2) then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doPlayerAddItem(cid, 2160, 2, TRUE) -- 2. Treat - 2cc + Blessy.
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins and All Blessings.")
return true

elseif (liczba == 3) then
local z = math.random(1,12)
doPlayerAddItem(cid, runyyy_id[z], x[z]) -- 3. Treat - Losowa Runka x50, lub Runka z PACC'em.
nazwa = getItemNameById(runyyy_id[z])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got ".. x[z] .."x ".. nazwa .. ".")
doRemoveItem(item.uid, 1)
return true

elseif (liczba == 4) then
doPlayerAddItem(cid, 6569, 25) -- 4. Treat - 25x cukierkow
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 25 Candies.")
doRemoveItem(item.uid, 1)
return true

elseif (liczba == 5) then
doPlayerAddExperience(cid, 500000) -- 5. Treat - 500k Expa
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received 500k Experience Points, Please Re-Log.")
doRemoveItem(item.uid, 1)
return true


elseif (liczba == 6) then
doTeleportThing(cid,{x=464, y=525, z=9}) -- 6. Trick - Teleport na zadupie
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Tricket ! Hmm how to back ?")
doRemoveItem(item.uid, 1)
return true

elseif (liczba == 7) then
doRemoveItem(item.uid, 1)
doRemoveCreature(cid, true) -- 7. Trick - Kick
return true

elseif (liczba == 8) then

if (getPlayerSex(cid) == 0) then -- 8. Trick - Zmiana p?ci
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Owned ! Re-Log ! :D")
doRemoveItem(item.uid, 1)
return true

elseif (liczba == 9) then
doPlayerSay(cid, "JESTEM PEDALEM") -- 9. Trick - Krzyczy
doRemoveItem(item.uid, 1)
return true

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This bag was empty.") -- 10. Trick - Pusty worek
doRemoveItem(item.uid, 1)
return true
end
return true
end[/LUA]

Wersja dla pro's?w:
[LUA]-- ToT by Leon Zawodowiec --
-- Made for Halloween Update --
-- Remade by Simon --

function onUse(cid, item, frompos, item2, topos)

-- no spoko expl dest fbomb hmm gfb sd mwal uh paral ava 5d 10d
local runyyy_id = {2313, 2261, 2305, 2311, 2304, 2268, 2293, 2273, 2278, 2274, 2280, 2282}
local x = {50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 1, 1}
local treats = {[1] = {f = function(cid,uid)
doPlayerAddItem(cid, 2160, 2, TRUE) -- 1. Treat - 2cc.
doRemoveItem(uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins.")
end},
[2] = {f = function(cid,uid)
for i = 1, 5 do
doPlayerAddBlessing(cid, i)
end
doPlayerAddItem(cid, 2160, 2, TRUE) -- 2. Treat - 2cc + Blessy.
doRemoveItem(uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins and All Blessings.")
end},
[3] = {f = function(cid,uid)
local z = math.random(1,12)
doPlayerAddItem(cid, runyyy_id[z], x[z]) -- 3. Treat - Losowa Runka x50, lub Runka z PACC'em.
nazwa = getItemNameById(runyyy_id[z])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got ".. x[z] .."x ".. nazwa .. ".")
doRemoveItem(uid, 1)
end},
[4] = {f = function(cid,uid)
doPlayerAddItem(cid, 6569, 25) -- 4. Treat - 25x cukierkow
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 25 Candies.")
doRemoveItem(uid, 1)
end},
[5] = {f = function(cid,uid)
doPlayerAddExperience(cid, 500000) -- 5. Treat - 500k Expa
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received 500k Experience Points, Please Re-Log.")
doRemoveItem(uid, 1)
end},
[6] = {f = function(cid,uid)
doTeleportThing(cid,{x=464, y=525, z=9}) -- 6. Trick - Teleport na zadupie
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Tricket ! Hmm how to back ?")
doRemoveItem(uid, 1)
end},
[7] = {f = function(cid,uid)
doRemoveItem(uid, 1)
doRemoveCreature(cid, true) -- 7. Trick - Kick
end},
[8] = {f = function(cid,uid)
if (getPlayerSex(cid) == 0) then -- 8. Trick - Zmiana p?ci
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Owned ! Re-Log ! :D")
doRemoveItem(uid, 1)
end},
[9] = {f = function(cid,uid)
doPlayerSay(cid, "JESTEM PEDALEM") -- 9. Trick - Krzyczy
doRemoveItem(uid, 1)
end},
[10] = {f = function(cid,uid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This bag was empty.") -- 10. Trick - Pusty worek
doRemoveItem(uid, 1)
end}
}
local liczba = math.random(1,#treats)

treats[liczba].f(cid,item.uid) -- wywo?anie funkcji danego psikusa
return true
end[/LUA]

W actions.xml:
[XML]<action itemid="6497" event="script" value="halloween/tot.lua"/>[/XML]
 
Status
Not open for further replies.
Top