Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Biblioteka Skryptów


Things

Rekomendowane odpowiedzi

Opublikowano

Wielka biblioteka skryptów

 

 

Skrypt na Kasyno do najnowszej tibi 8,6 8,7

 

 

 

Data/acotion/scrip nazwa : kasyno1.lua

 

function onUse(cid, item, frompos, itemEx, topos)
local pos = getCreaturePosition(cid)
local config = {
               [6000] = {pos_kaski={x=pos.x+1,y=pos.y,z=pos.z,stackpos=255}, pos_nagrody={x=pos.x+1,y=pos.y+1,z=pos.z}},
               [6001] = {pos_kaski={x=pos.x,y=pos.y+1,z=pos.z,stackpos=255}, pos_nagrody={x=pos.x+1,y=pos.y+1,z=pos.z}},
               [6002] = {pos_kaski={x=pos.x-1,y=pos.y,z=pos.z,stackpos=255}, pos_nagrody={x=pos.x-1,y=pos.y+1,z=pos.z}},
               [6003] = {pos_kaski={x=pos.x,y=pos.y-1,z=pos.z,stackpos=255}, pos_nagrody={x=pos.x+1,y=pos.y-1,z=pos.z}}
               }
local config_2 = {
               [1] = {ile_cc=5, szansa=20, wygrana=15},
               [2] = {ile_cc=10, szansa=15, wygrana=25},
               [3] = {ile_cc=25, szansa=10, wygrana=50},
               [4] = {ile_cc=50, szansa=5, wygrana=100}
               }
local dzwignia = config[item.actionid]
local position_kasy = getThingFromPos(dzwignia.pos_kaski)
local rand = math.random(1,100)
if dzwignia then
   if item.itemid == 1945 then
       if position_kasy.itemid == 2160 then
           for i=1, #config_2 do
           if position_kasy.type == config_2[i].ile_cc then
               if rand >= config_2[i].szansa then
                   doTransformItem(item.uid, item.itemid+1)
                   doRemoveItem(position_kasy.uid, config_2[i].ile_cc)
                   doSendMagicEffect(dzwignia.pos_kaski, 2)
                   doPlayerSendTextMessage(cid, 22, "Straciles "..config_2[i].ile_cc.." Crystal Coins .")
                   return true
               else
                   doTransformItem(item.uid, item.itemid+1)
                   doRemoveItem(position_kasy.uid, config_2[i].ile_cc)
                   doCreateItem(2160, config_2[i].wygrana, dzwignia.pos_nagrody)
                   doSendMagicEffect(dzwignia.pos_nagrody, 13)
                   doSendMagicEffect(position_kasy, 21)
                   doPlayerSendTextMessage(cid, 22, "Gratulacje Wygrales "..config_2[i].wygrana.." Crystal Coins .")
                   return true
               end
           end
           end
       else
           doPlayerSendTextMessage(cid, 22, "Poloz kase.")
           return true
       end
   elseif item.itemid == 1946 then
       doTransformItem(item.uid, item.itemid-1)
   end
end    
return true
end

 

Do Actions.xml

 

<action fromaid="6000" toaid="6003" event="script" value="kasyno1.lua"/>

 

 

ToT Bag (Trick or Treat - Halloween)

 

 

 

Skrypt ten zrobiłem na Halloween, już wyjaśniam na czym on polega..

 

 

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:

2 Crystal Coins

2 Crystal Coins + All Blessings

Losowa Runka z Tablicy..

25 Cukierków

500k Expa

Teleport na zadupie

Kick

Zmiana płci gracza

Wykrzyknięcie jakiegoś tekstu przez gracza

Pusty worek

 

 

Przejdźmy do skryptu..

 

W Actions/scripts/halloween/tot.lua

 

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 ! ")
       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

 

W Actions.xml

 

<action itemid="6497" event="script" value="halloween/tot.lua"/>

 

 

Daily Quest

 

 

Tym razem Daily Quest.

 

Nagrodę możemy wziąć co 24 godziny. Domyślne ustawiona jest: 1 cc.

Dodatkiem jest licznik, który pokazuje nam ile razy wzięliśmy nagrodę. Można to zastosować gdzieś na stronce jako wskaźnik "zajebistości" :D

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 1 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 13541)
   if (daily == -1) then
           daily = 0
   end
   if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
       doPlayerAddItem(cid, 2160, 1)
       time = os.time() + daysvalue
       setPlayerStorageValue(cid, 13540, time)    
       setPlayerStorageValue(cid, 13541, daily+1)
       local daily = getPlayerStorageValue(cid, 13541)
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
   else
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: "  .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) ..  ".")
   end
   return true
end

 

Actions.xml

 

<action actionid="7777" event="script" value="daily.lua"/>

 

 

 

Frag Remover

 

Witam, chciałbym przedstawić wam mój skrypt "Frag Remover".

Skrypt ten był testowany pod TFS'a 0.3.6 PL.

 

Opis:

 

Po użyciu itemu usuwają się fragi z bazy danych oraz skull.

Frag Removera można użyć tylko na RS'ie lub BS'ie.

Nie działa na White Skulla ! (Można włączyć ale nie polecam.. )

 

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

local skull = getCreatureSkullType(cid)

   if skull == SKULL_NONE then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have any skull !")
   return 0
   end

   if skull == SKULL_YELLOW then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove yellow skull !")
   return 0
   end

   if skull == SKULL_GREEN then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove green skull !")
   return 0
   end

   if skull == SKULL_WHITE then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove white skull !")
   return 0
   end

   if skull == SKULL_RED then
       (doPlayerRemoveItem(cid, 9969, 1) == TRUE)
       doCreatureSetSkullType(cid, SKULL_NONE)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Red Skull has been removed !")
       db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
       return 0
   else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Take your Frag Remover to your BackPack !")
       return 0
   end

   if skull == SKULL_BLACK then
       (doPlayerRemoveItem(cid, 9969, 1) == TRUE)
       doCreatureSetSkullType(cid, SKULL_NONE)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Black Skull has been removed !")
       db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
       return 0
   else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Take your Frag Remover to your BackPack !")
       return 0
   end
return true
end

 

Actions.xml

 

<action itemid="9969" event="script" value="skull.lua"/>

 

 

Upgrade Stone

 

 

1. Zwiększa atrybuty przedmiotu.

2. Można ustawić max lv, oraz szanse na powodzenie.

3. Obecny poziom przedmiotu widoczny jest w "Look", np. Mace +4

 

if getItemAttribute(itemEx.uid,"itemlevel") == nil then
doItemSetAttribute(itemEx.uid, "itemlevel",0)
end
if (getItemAttribute(itemEx.uid,"itemlevel") + 1) <= maxlvl then
if szansa>=math.random(1,100)
 if getItemInfo(itemEx.itemid).attack > 0 and getItemAttribute(itemEx.uid,"attack") == nil then
  doItemSetAttribute(itemEx.uid, "attack",getItemInfo(itemEx.itemid).attack)
 end
 if getItemInfo(itemEx.itemid).defense > 0 and getItemAttribute(itemEx.uid,"defense") == nil then
  doItemSetAttribute(itemEx.uid, "defense",getItemInfo(itemEx.itemid).defense)
 end
 if getItemInfo(itemEx.itemid).armor > 0 and getItemAttribute(itemEx.uid,"armor") == nil then
  doItemSetAttribute(itemEx.uid, "armor",getItemInfo(itemEx.itemid).armor)
 end
 if getItemAttribute(itemEx.uid, "attack") ~= nil then
  doItemSetAttribute(itemEx.uid, "attack",getItemAttribute(itemEx.uid, "attack") + (math.random(1,20+getItemAttribute(itemEx.uid,"itemlevel"))))
 end 
 if getItemAttribute(itemEx.uid, "armor") ~= nil then
  doItemSetAttribute(itemEx.uid, "armor",getItemAttribute(itemEx.uid, "armor") + (math.random(1,5)))
 end 
 if getItemAttribute(itemEx.uid, "defense") ~= nil then
  doItemSetAttribute(itemEx.uid, "defense",getItemAttribute(itemEx.uid, "defense") + (math.random(1,20+getItemAttribute(itemEx.uid,"itemlevel"))))
 end 
 doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " +" .. getItemAttribute(itemEx.uid,"itemlevel") + 1)
 doItemSetAttribute(itemEx.uid, "itemlevel",getItemAttribute(itemEx.uid,"itemlevel") + 1)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You have successfully enchanted " .. getItemArticleById(itemEx.itemid) .. " " .. getItemInfo(itemEx.itemid).name .. " to +".. getItemAttribute(itemEx.uid,"itemlevel") ..".")
 doSendMagicEffect(getPlayerPosition(cid),39)
 doRemoveItem(item.uid,1)
else
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Sorry, your item has broken.")
 doRemoveItem(itemEx.uid,1)
 doRemoveItem(item.uid,1)
end
else
doPlayerSendCancel(cid,"You may not upgrade this item higher.")
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
end

else
doPlayerSendCancel(cid,"You can only upgrade armors and weapons.")
end
return true
end

 

W actions.xml dać:

<action itemid="8300" event="script" value="upgrade.lua"/>

 

 

Rust Remover (99% Real Tibia)

 

 

Jest to dopiero początek ! - Działa on tylko na Rust Armory (Common, Semi-Rare, Rare).

 

Muszę jeszcze zrobić Legs, Shield, itd. - Kwestia dodania ich do tablicy.

 

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

   local effect_broke = 3
   local effect_renew = 28
   local wylosowany = 0
   local const = item2.itemid
   local pos = getCreaturePosition(cid)
   local itemy = {

                   [9808] = {
                               [1] = {id = 2464, name = "Chain Armor", szansa = 33},
                               [2] = {id = 2483, name = "Scale Armor", szansa = 25},
                               [3] = {id = 2465, name = "Brass Armor", szansa = 10},
                               [4] = {id = 2463, name = "Plate Armor", szansa = 2}
                            },

                   [9809] = {
                               [1] = {id = 2464, name = "Chain Armor", szansa = 16},
                               [2] = {id = 2465, name = "Brass Armor", szansa = 14},
                               [3] = {id = 2483, name = "Scale Armor", szansa = 13},
                               [4] = {id = 2463, name = "Plate Armor", szansa = 10},
                               [5] = {id = 2476, name = "Knight Armor", szansa = 6},
                               [6] = {id = 8891, name = "Paladin Armor", szansa = 3},
                               [7] = {id = 2487, name = "Crown Armor", szansa = 1}
                            },

                   [9810] = {
                               [1] = {id = 2464, name = "Chain Armor", szansa = 20},
                               [2] = {id = 2465, name = "Brass Armor", szansa = 17},
                               [3] = {id = 2483, name = "Scale Armor", szansa = 15},
                               [4] = {id = 2463, name = "Plate Armor", szansa = 12},
                               [5] = {id = 2476, name = "Knight Armor", szansa = 10},
                               [6] = {id = 8891, name = "Paladin Armor", szansa = 5},
                               [7] = {id = 2487, name = "Crown Armor", szansa = 4},
                               [8] = {id = 2466, name = "Golden Armor", szansa = 2},
                               [9] = {id = 2472, name = "Magic Plate Armor", szansa = 1}
                            },

                   [9811] = {
                               [1] = {id = 2468, name = "Studded Legs", szansa = 33},
                               [2] = {id = 2648, name = "Chain Legs", szansa = 25},
                               [3] = {id = 2478, name = "Brass Legs", szansa = 10},
                               [4] = {id = 2647, name = "Plate Legs", szansa = 2}
                            },

                   [9812] = {
                               [1] = {id = 2468, name = "Studded Legs", szansa = 16},
                               [2] = {id = 2648, name = "Chain Legs", szansa = 14},
                               [3] = {id = 2478, name = "Brass Legs", szansa = 13},
                               [4] = {id = 2647, name = "Plate Legs", szansa = 10},
                               [5] = {id = 2477, name = "Knight Legs", szansa = 6},
                               [7] = {id = 2488, name = "Crown Legs", szansa = 1}
                            },

                   [9813] = {
                               [2] = {id = 2478, name = "Brass Legs", szansa = 17},
                               [4] = {id = 2647, name = "Plate Legs", szansa = 12},
                               [5] = {id = 2477, name = "Knight Legs", szansa = 10},
                               [7] = {id = 2488, name = "Crown Legs", szansa = 4},
                               [8] = {id = 2470, name = "Golden Legs", szansa = 2}
                            }

               }  

   if itemy[const] then
       local random_item = math.random(1, 100)

       for i = 1, #itemy[const] do
           if random_item <= itemy[const][i].szansa then
               wylosowany = i
           end
       end    

       if wylosowany > 0 then
           doSendMagicEffect(topos, effect_renew)
           doTransformItem(item2.uid, itemy[const][wylosowany].id)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have renewed the ".. itemy[const][wylosowany].name .." !")
           doRemoveItem(item.uid, 1)
       else
           doSendMagicEffect(topos, effect_broke)
           doRemoveItem(item2.uid, 1)
           doRemoveItem(item.uid, 1)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Rusty Remover has broken.")
           return 0
       end
   else
         doPlayerSendTextMessage(cid, 24,"Use it on Rusty Items (Common, Semi-Rare or Rare: Armors or Legs).")
       return 0
   end
return true
end

 

Actions.xml

 

<action itemid="9930" event="script" value="tools/rust remover.lua"/>

 

 

Event BoX

 

 

 

Chciał bym wam zaprezentować skrypt na bardzo ciekawy i zarazem prosty item, który w łatwy sposób może urozmaicić nasz sms shoop.

Event box w skrócie jest to paczka która daje nam losowy item z sms shop, możemy dodać ja do jakiegoś eventu.

 

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

presente = math.random(1,28)
pos = getPlayerPosition(cid)

if presente == 1 then
doSendMagicEffect(pos,27)
doPlayerAddItem(cid,2160,100) --cc
doRemoveItem(item.uid,1)

elseif presente == 2 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2197,100) --ssa
doRemoveItem(item.uid,1)

elseif presente == 3 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2263,1) --ssd
doRemoveItem(item.uid,1)

elseif presente == 4 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2300,1) --smr
doRemoveItem(item.uid,1)

elseif presente == 5 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2276,1) -- suh
doRemoveItem(item.uid,1)

elseif presente == 6 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2295,1) --pall rune
doRemoveItem(item.uid,1)

elseif presente == 7 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,5785,1) -- vip
doRemoveItem(item.uid,1)

elseif presente == 8 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,5865,1) -- event token
doRemoveItem(item.uid,1)

elseif presente == 9 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,6132,1) -- softy
doRemoveItem(item.uid,1)

elseif presente == 10 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8932,1) -- sword
doRemoveItem(item.uid,1)

elseif presente == 11 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,5803,1) --arbalest
doRemoveItem(item.uid,1)

elseif presente == 12 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8927,1) --mace
doRemoveItem(item.uid,1)

elseif presente == 13 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8293,1) --axe
doRemoveItem(item.uid,1)

elseif presente == 14 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8918,1) --spell book
doRemoveItem(item.uid,1)

elseif presente == 15 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8868,1) --mage
doRemoveItem(item.uid,1)

elseif presente == 16 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8888,1) --pall
doRemoveItem(item.uid,1)

elseif presente == 17 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8889,1) --knight
doRemoveItem(item.uid,1)

elseif presente == 18 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,10016,1) -- mage hat
doRemoveItem(item.uid,1)

elseif presente == 19 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,7896,1) --magic legs
doRemoveItem(item.uid,1)

elseif presente == 20 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,9777,1) --yalkhar legs
doRemoveItem(item.uid,1)

elseif presente == 21 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8905,1) --shield
doRemoveItem(item.uid,1)

elseif presente == 22 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8910,1) --wand
doRemoveItem(item.uid,1)

elseif presente == 23 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,8922,1) --wand
doRemoveItem(item.uid,1)

elseif presente == 24 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,7722,1) -- exp scrool
doRemoveItem(item.uid,1)

elseif presente == 25 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,7720,1) --skill
doRemoveItem(item.uid,1)

elseif presente == 26 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,9933,1) --f boots
doRemoveItem(item.uid,1)

elseif presente == 27 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,2363,1) --event orb
doRemoveItem(item.uid,1)

elseif presente == 28 then
doSendMagicEffect(pos,53)
doPlayerAddItem(cid,7735,1) --super wand
doRemoveItem(item.uid,1)
end

return 1
end

 

do actions.xml wklejamy:

 

<action itemid="10503" script="tools/event box.lua"/>

 

 

 

 

4 nowe czary

 

 

 

Dzisiaj przestudiowałem i stworzyłem 4 czary 1 na profesje .

Możesz pytać "Ale po co ?"

Odp. W tibii dysponujemy nowymi czarami do 60 lv , lecz jest stworzyłem cudeńka na 100lv , a oto one :

 

local area1 = createCombatArea(arr1) 
local area2 = createCombatArea(arr2) 
local area3 = createCombatArea(arr3) 

setCombatArea(combat1, area1) 
setCombatArea(combat2, area2) 
setCombatArea(combat3, area3) 

local function onCastSpell1(parameters) 
   doCombat(parameters.cid, parameters.combat1, parameters.var) 
end 

local function onCastSpell2(parameters) 
   doCombat(parameters.cid, parameters.combat2, parameters.var) 
end 

local function onCastSpell3(parameters) 
   doCombat(parameters.cid, parameters.combat3, parameters.var) 
end 

function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4 }  
addEvent(onCastSpell1, 8, parameters)  
addEvent(onCastSpell2, 17, parameters)  
addEvent(onCastSpell3, 35, parameters) 
addEvent(onCastSpell1, 70, parameters)  
addEvent(onCastSpell1, 75, parameters)  
addEvent(onCastSpell3, 80, parameters) 

end  

 

 

 

local combat1 = createCombatObject() 
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE) 
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) 
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat2 = createCombatObject() 
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN) 
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_PLANTATTACK) 
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat3 = createCombatObject() 
setCombatParam(combat3, COMBAT_PARAM_TYPE, 512) 
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_GIANTICE) 
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

arr1 = { 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 1, 1, 1, 0, 0,}, 
{0, 0, 1, 2, 1, 0, 0,}, 
{0, 0, 1, 1, 1, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
}; 
arr2 = { 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 1, 1, 1, 1, 1, 0,}, 
{0, 1, 0, 0, 0, 1, 0,}, 
{0, 1, 0, 2, 0, 1, 0,}, 
{0, 1, 0, 0, 0, 1, 0,}, 
{0, 1, 1, 1, 1, 1, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
}; 
arr3 = { 
{1, 1, 1, 1, 1, 1, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 2, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 1, 1, 1, 1, 1, 1,}, 
}; 


local area1 = createCombatArea(arr1) 
local area2 = createCombatArea(arr2) 
local area3 = createCombatArea(arr3) 

setCombatArea(combat1, area1) 
setCombatArea(combat2, area2) 
setCombatArea(combat3, area3) 

local function onCastSpell1(parameters) 
   doCombat(parameters.cid, parameters.combat1, parameters.var) 
end 

local function onCastSpell2(parameters) 
   doCombat(parameters.cid, parameters.combat2, parameters.var) 
end 

local function onCastSpell3(parameters) 
   doCombat(parameters.cid, parameters.combat3, parameters.var) 
end 

function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4 }  
addEvent(onCastSpell1, 8, parameters)  
addEvent(onCastSpell2, 17, parameters)  
addEvent(onCastSpell3, 35, parameters) 
addEvent(onCastSpell1, 70, parameters)  
addEvent(onCastSpell2, 75, parameters)  
addEvent(onCastSpell3, 80, parameters) 

end  

 

 

local combat1 = createCombatObject() 
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) 
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA) 
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat2 = createCombatObject() 
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) 
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_YALAHARIGHOST) 
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat3 = createCombatObject() 
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) 
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) 
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

arr1 = { 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{1, 1, 1, 2, 1, 1, 1,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
}; 
arr2 = { 
{1, 1, 1, 0, 1, 1, 1,}, 
{1, 1, 1, 0, 1, 1, 1,}, 
{1, 1, 1, 0, 1, 1, 1,}, 
{1, 1, 1, 0, 1, 1, 1,}, 
{0, 0, 0, 2, 0, 0, 0,}, 
{1, 1, 1, 0, 1, 1, 1,}, 
{1, 1, 1, 0, 1, 1, 1,}, 
}; 
arr3 = { 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{1, 1, 1, 2, 1, 1, 1,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
{0, 0, 0, 1, 0, 0, 0,}, 
}; 


local area1 = createCombatArea(arr1) 
local area2 = createCombatArea(arr2) 
local area3 = createCombatArea(arr3) 

setCombatArea(combat1, area1) 
setCombatArea(combat2, area2) 
setCombatArea(combat3, area3) 

local function onCastSpell1(parameters) 
   doCombat(parameters.cid, parameters.combat1, parameters.var) 
end 

local function onCastSpell2(parameters) 
   doCombat(parameters.cid, parameters.combat2, parameters.var) 
end 

local function onCastSpell3(parameters) 
   doCombat(parameters.cid, parameters.combat3, parameters.var) 
end 

function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4 }  
addEvent(onCastSpell1, 8, parameters)  
addEvent(onCastSpell2, 10, parameters)  
addEvent(onCastSpell3, 9, parameters) 
addEvent(onCastSpell1, 11, parameters)  
addEvent(onCastSpell1, 13, parameters)  
addEvent(onCastSpell3, 12, parameters) 

end  

 

local combat1 = createCombatObject() 
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) 
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) 
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat2 = createCombatObject() 
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) 
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT) 
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

local combat3 = createCombatObject() 
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) 
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) 
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.0, -150, -1.6, -150) 

arr1 = { 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 1, 1, 1, 0, 0,}, 
{0, 0, 1, 2, 1, 0, 0,}, 
{0, 0, 1, 1, 1, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
}; 
arr2 = { 
{0, 0, 0, 0, 0, 0, 0,}, 
{0, 1, 1, 1, 1, 1, 0,}, 
{0, 1, 0, 0, 0, 1, 0,}, 
{0, 1, 0, 2, 0, 1, 0,}, 
{0, 1, 0, 0, 0, 1, 0,}, 
{0, 1, 1, 1, 1, 1, 0,}, 
{0, 0, 0, 0, 0, 0, 0,}, 
}; 
arr3 = { 
{1, 1, 1, 1, 1, 1, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 2, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 0, 0, 0, 0, 0, 1,}, 
{1, 1, 1, 1, 1, 1, 1,}, 
}; 


local area1 = createCombatArea(arr1) 
local area2 = createCombatArea(arr2) 
local area3 = createCombatArea(arr3) 

setCombatArea(combat1, area1) 
setCombatArea(combat2, area2) 
setCombatArea(combat3, area3) 

local function onCastSpell1(parameters) 
   doCombat(parameters.cid, parameters.combat1, parameters.var) 
end 

local function onCastSpell2(parameters) 
   doCombat(parameters.cid, parameters.combat2, parameters.var) 
end 

local function onCastSpell3(parameters) 
   doCombat(parameters.cid, parameters.combat3, parameters.var) 
end 

function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4 }  
addEvent(onCastSpell1, 8, parameters)  
addEvent(onCastSpell2, 17, parameters)  
addEvent(onCastSpell3, 35, parameters) 
addEvent(onCastSpell1, 70, parameters)  
addEvent(onCastSpell2, 75, parameters)  
addEvent(onCastSpell3, 80, parameters) 

end  

 

 

 <instant name="Massive Druid" words="exevo mas druid" selftarget="no"  direction="no" aggressive="yes" lvl="100" maglv="10" mana="2000" soul="0" exhaustion="0" prem="no" enabled="1" script="attack/Massive Druid.lua"> 
   <vocation id="2"/> 
   <vocation id="6"/> 
   <vocation id="10"/> 
   </instant> 

       <instant name="Massive Sorcerer" words="exevo mas sorc" selftarget="no"  direction="no" aggressive="yes" lvl="100" maglv="10" mana="2000" soul="0" exhaustion="0" prem="no" enabled="1" script="attack/Massive Sorcerer.lua"> 
   <vocation id="1"/> 
   <vocation id="5"/> 
   <vocation id="9"/> 
   </instant> 

           <instant name="Massive Knight" words="exevo mas knight" selftarget="no"  direction="no" aggressive="yes" lvl="100" maglv="10" mana="2000" soul="0" exhaustion="0" prem="no" enabled="1" script="attack/Massive Knight.lua"> 
   <vocation id="4"/> 
   <vocation id="8"/> 
   <vocation id="12"/> 
   </instant> 

               <instant name="Massive Palladyn" words="exevo mas pall" selftarget="no"  direction="no" aggressive="yes" lvl="100" maglv="10" mana="2000" soul="0" exhaustion="0" prem="no" enabled="1" script="attack/Massive Palladyn.lua"> 
   <vocation id="3"/> 
   <vocation id="7"/> 
   <vocation id="11"/> 
   </instant>  

 

 

Super Wand

 

 

W data/items/items.xml Zamieniamy:

 

<item id="7735" name="magical wand">
</item>

na :

 

<item id="7735" article="a" name="Super Wand">
	<attribute key="description" value="najlepszy Wand na OTS. "/>
	<attribute key="weight" value="1950"/>
	<attribute key="weaponType" value="wand"/>
	<attribute key="range" value="2"/>

 

w weapons/weapons.xml wpisujemy:

 

<wand id="7735" range="8" lvl="150" mana="20" enabled="1" exhaustion="0" script="Super Wand.lua"><vocation id="1"/><vocation id="5"/><vocation id="2"/><vocation id="6"/></wand>

 

w data/weapons/scripts tworzymy plik " Super Wand.lua " a w nim:

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 31)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -100, 0, -110)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end

 

Dmg se możesz zmienić

 

 

4 nowe bronie

 

 

1.Stone Rod

 

w data/items/items.xml wpisujemy :

 

<item id="2424" article="a" name="Stone Rod">
<attribute key="description" value=""/>
<attribute key="weight" value="2100"/>
<attribute key="weaponType" value="wand"/>
<attribute key="range" value="1"/>
</item>

 

w weapons/weapons.xml wpisujemy :

 

<wand id="2424" range="3" lvl="150" mana="0" enabled="1" exhaustion="0" script="stone rods.lua"><vocation id="1"/><vocation id="5"/></wand>

 

w data/scripts/ tworzymy plik o nazwie "Stone rods.lua" i wpisujemy w nim :

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 44)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.9, -300, -1.6, 1000)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)

 

2. Ice storm rod

 

w data/items/items.xml wpisujemy:

 

<item id="7409" article="a" name="Ice Storm Rod"> <!-- This isn't a real item -->
<attribute key="description" value="It grants you the power of striking your foes with furious Ice Storms. It can only be wielded properly by druids of level 150 or higher."/>
<attribute key="weight" value="2100"/>
<attribute key="weaponType" value="wand"/>
<attribute key="range" value="1"/>
</item>

 

w weapons/weapons.xml wpisujemy :

 

<wand id="7409" range="3" lvl="150" mana="150" enabled="1" exhaustion="0" script="Ice Storm rod.lua"><vocation id="2"/><vocation id="6"/></wand>

 

w data/scripts/ tworzymy plik o nazwie "ice strom rod.lua" i wpisujemy w nim :

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 42)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.9, -300, -1.6, 1000)
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end

 

3.Great holy rod

 

w data/items/items.xml wpisujemy :

 

<item id="7410" article="a" name="Great Holy rod">
<attribute key="description" value="To Bron dystansowa syna Druidki i ojca druida wylacznie dla paladynow z 150 levelem lub wyzszym."/>
<attribute key="weight" value="2100"/>
<attribute key="weaponType" value="wand"/>
<attribute key="range" value="1"/>
</item>

 

w weapons/weapons.xml wpisujemy :

 

<wand id="7410" range="3" lvl="150" mana="0" enabled="1" exhaustion="0" script="Great Holy.lua"><vocation id="3"/><vocation id="7"/></wand>

 

w data/scripts/ tworzymy plik o nazwie "great holy.lua" i wpisujemy w nim :

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 39)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.9, -250, -1.6, 800)

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)

 

 

4.assassin dagger

 

w data/items/items.xml wpisujemy :

 

<item id="7404" article="an" name="assassin dagger">
<attribute key="weight" value="1700"/>
<attribute key="defense" value="24"/>
<attribute key="attack" value="46"/>
<attribute key="weaponType" value="sword"/>
<attribute key="range" value="2"/>
</item>

 

w weapons/weapons.xml wpisujemy :

 

<melee id="7404" enabled="1" exhaustion="0" hitchance="100" script="magesage sword.lua"></melee>

 

w data/scripts/ tworzymy plik o nazwie "magesage sword.lua" i wpisujemy w nim :

 

local combat = createCombatObject()
local combat2 = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 0, 0)


setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0, 0, 0, 0)

function onUseWeapon(cid, var)
doCombat(cid, combat2, var)
return doCombat(cid, combat, var)
end

 

 

 

Apocalypse, Infernatil, Bazir, Verminor

 

 

Apocalypse:

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Apocalypse" nameDescription="Apocalypse" race="fire" experience="80000" speed="400" manacost="0">
 <health now="160000" max="160000"/>
 <look type="12" head="39" body="14" legs="56" feet="85" corpse="6068"/>
 <targetchange interval="10000" chance="5"/>
 <strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="0"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="0"/>
   <flag convinceable="0"/>
   <flag pushable="0"/>
   <flag canpushitems="1"/>
   <flag canpushcreatures="1"/>
   <flag staticattack="85"/>
   <flag targetdistance="1"/>
   <flag runonhealth="0"/>
 </flags>
<attacks>
   <attack name="melee" interval="2000" target="5" min="0" max="-3000"/>
   <attack name="fire" interval="1000" chance="13" range="7" radius="6" target="1" min="0" max="-1200">
       <attribute key="shootEffect" value="fire"/>
       <attribute key="areaEffect" value="firearea"/>
   </attack>
	<attack name="energy" interval="2000" chance="18" min="-0" max="-1300">
		<attribute key="shootEffect" value="energy"/>
		<attribute key="areaEffect" value="purpleenergy"/>
	</attack>
	<attack name="lifedrain" interval="1000" chance="30" range="5" radius="1" target="1" min="-0" max="-1500">
	<attribute key="shootEffect" value="death"/>
		<attribute key="areaEffect" value="rednote"/>
	</attack>
	<attack name="melee" interval="3000" chance="15" range="7" radius="3" target="0" min="-1000" max="-3000">
		<attribute key="areaEffect" value="blackspark"/>
	</attack>
   <attack name="death" interval="3000" chance="15" radius="7" target="0" min="-4000" max="-4000">
       <attribute key="areaEffect" value="mortarea"/>
   </attack>
   <attack name="energy" interval="2000" chance="16" length="7" spread="0" min="-0" max="-1300">
       <attribute key="areaEffect" value="purpleenergy"/>
   </attack>
   <attack name="speed" interval="3000" chance="25" target="1" speedchange="-1000" duration="4000">
       <attribute key="areaEffect" value="redshimmer"/>
   </attack>
</attacks>
<defenses armor="70" defense="70">
 </defenses>
   <elements>
       <element physicalPercent="0"/>
       <element icePercent="0"/>
       <element deathPercent="0"/>
   </elements>
 <immunities>
   <immunity energy="1"/>
   <immunity fire="1"/>
   <immunity poison="1"/>
   <immunity lifedrain="1"/>
   <immunity paralyze="1"/>
   <immunity invisible="1"/>
 </immunities>
 <summons maxSummons="6">
   <summon name="demon" interval="15000" chance="100"/>
   <summon name="demon" interval="15000" chance="100"/>
   <summon name="demon" interval="15000" chance="100"/>
   <summon name="demon" interval="15000" chance="100"/>
   <summon name="demon" interval="15000" chance="100"/>
   <summon name="demon" interval="15000" chance="100"/>                          
 </summons>
 <voices interval="5000" chance="10">
   <voice sentence="DESTRUCTION!" yell="1"/>
   <voice sentence="BOW TO THE POWER OF THE RUTHLESS SEVEN!"/>
   <voice sentence="CHAOS!"/>
   <voice sentence="DEATH TO ALL!" yell="1"/>
 </voices>
   <loot>
	<item id="5954" countmax="20" chance1="12000"/> --demon horn
       <item id="8901" chance="20000"/> --spellbook of warding
       <item id="2148" chance1="100000" countmax="100"/> --gold coin
       <item id="2152" chance1="18000" countmax="74"/> --platinum
           <item id="5954" chance1="15000" countmax="2"/> --demon horn
		<item id="8884" chance="50000"/> --oceanborn armor
           <item id="2197" chance="15000"/> --stoneskin amulet
           <item id="6529" chance1="22000" countmax="100"/> --infernal bolt
           <item id="2033" chance="16000"/> --golden mug
           <item id="7421" chance="600"/> --onyx flail
           <item id="8881" chance="5000"/> --fireborn giantarmor
           <item id="2112" chance="1000"/> --teddy bear
           <item id="8472" chance="18000"/> --great spirit potion
           <item id="2520" chance="13000"/> --demon shield
           <item id="2472" chance="3000"/> --magic plate armor
           <item id="2123" chance="13000"/> --ring of the sky
           <item id="8929" chance="30000"/> --stomper
           <item id="2171" chance="17000"/> --platinum amulet
           <item id="6500" chance1="13000" countmax="5"/> --essence
           <item id="8886" chance="3000"/> --stomper
           <item id="2170" chance="15000"/> --silver amulet
           <item id="8886" chance="2000"/> --molten plate
           <item id="2470" chance="10000"/> --golden legs
		<item id="8926" chance="100000"/> --demonwing axe
		<item id="2469" chance="100000"/> --dragon scale legs
		<item id="2523" chance="100000"/> --blessed shield
           <item id="8867" chance="4000"/> --dragon robe
           <item id="2149" chance1="20000" countmax="7"/> --small emerald
           <item id="8865" chance="7000"/> --darklords cape
		<item id="9971" countmax="100" chance="5000"/> --gold ingot
       <item id="1987" chance="100000"> --bag
           <inside>
               <item id="2145" chance1="150000" countmax="5"/> --small diamond
                       <item id="2143" chance1="180000" countmax="13"/> --white pearl
                       <item id="2155" chance="80000"/> --green gem
					<item id="2506" chance="80000"/> --dragon scale helmet
                       <item id="8850" chance="140000"/> --chain bolter
                       <item id="2390" chance="180000"/> --magic long sword
                       <item id="7431" chance="10000"/> --demonbone
                       <item id="6300" chance="150000"/> --death ring
                       <item id="8853" chance="100000"/> --iron bolter
                       <item id="8928" chance="50000"/> --obsidian trouchon
                       <item id="2195" chance="130000"/> --boots of haste
                       <item id="7591" chance="180000"/> --great health potion
                       <item id="2396" chance="200000"/> --ice rapier
                       <item id="8852" chance="70000"/> --devileye
                       <item id="2437" chance="160000"/> --golden mace
                       <item id="7899" chance="130000"/> --magma armor
                       <item id="2522" chance="7000"/> --great shield
                       <item id="2421" chance="7000"/> --thuder hammer
                       <item id="2393" chance="150000"/> --giant sword
                       <item id="8851" chance="30000"/> --royal crossbow
                       <item id="2514" chance="100000"/> --mastermind shield
                       <item id="8473" chance="140000"/> --ultimate health potion
                       <item id="2432" chance="160000"/> --fire axe
					<item id="2646" chance="100000"/> --golden boots
					<item id="2421" chance="700"/> --thudner hammer
                       <item id="2144" chance1="180000" countmax="13"/> --black pearl
           </inside>
       </item>
   </loot>
</monster>

 

Infernatil:

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Infernatil" nameDescription="a Infernatil" race="fire" experience="85000" speed="280" manacost="0">
<health now="160000" max="160000"/>
<look type="35" corpse="5995"/>
<targetchange interval="10000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
	<flag summonable="0"/>
	<flag attackable="1"/>
	<flag hostile="1"/>
	<flag illusionable="0"/>
	<flag convinceable="0"/>
	<flag pushable="0"/>
	<flag canpushitems="1"/>
	<flag canpushcreatures="1"/>
	<flag targetdistance="5"/>
	<flag staticattack="40"/>
	<flag runonhealth="0"/>
</flags>
<attacks>
	<attack name="melee" interval="2000" min="-3000" max="-6900"/>
	<attack name="fire" interval="2000" chance="14" range="7" radius="7" target="1" min="-2000" max="-5000">
		<attribute key="shootEffect" value="fire"/>
		<attribute key="areaEffect" value="firearea"/>
	</attack>
	<attack name="fire" interval="2000" chance="14" range="7" target="5" min="-160" max="-350">
		<attribute key="areaEffect" value="firearea"/>
	</attack>
	<attack name="firefield" interval="1000" chance="15" range="7" radius="4" target="1">
		<attribute key="shootEffect" value="fire"/>
	</attack>
	<attack name="speed" interval="10000" chance="25" target="1" speedchange="-2000" duration="5000">
       <attribute key="areaEffect" value="redshimmer"/>
   </attack>
</attacks>
<defenses armor="50" defense="55">
	<defense name="speed" interval="1000" chance="15" speedchange="1000" duration="20000">
		<attribute key="areaEffect" value="redshimmer"/>
	</defense>
</defenses>
<elements>
	<element firePercent="100"/>
	<element physicalPercent="0"/>
	<element earthpercent="100"/>
	<element energyPercent="100"/>
	<element deathPercent="-20"/>
	<element icePercent="-40"/>
	<element holyPercent="-30"/>
</elements>
<immunities>
	<immunity lifedrain="1"/>
	<immunity paralyze="1"/>
	<immunity invisible="1"/>
</immunities>
<summons maxSummons="2">
	<summon name="demon" interval="2000" chance="10" max="2"/>
</summons>
<voices interval="5000" chance="10">
	<voice sentence="Worship Zathroth pathetic mortal!" yell="1"/>
	<voice sentence="ASHES TO ASHES!" yell="1"/>
	<voice sentence="YOU WILL ALL BURN!" yell="1"/>
	<voice sentence="THE DAY OF RECKONING IS AT HAND!" yell="1"/>
	<voice sentence="BOW TO THE POWER OF THE RUTHLESS SEVEN!" yell="1"/>
	<voice sentence="Your soul will be mine!" yell="0"/>
</voices>
   <loot>
	<item id="5954" countmax="2" chance1="12000"/> --demon horn
           <item id="7421" chance="600"/> --onyx flail
           <item id="8881" chance="5000"/> --fireborn giantarmor
           <item id="2112" chance="1000"/> --teddy bear
           <item id="2472" chance="3000"/> --magic plate armor
           <item id="8929" chance="30000"/> --stomper
           <item id="6500" chance1="13000" countmax="100"/> --essence
           <item id="6500" chance1="13000" countmax="100"/> --essence
           <item id="8886" chance="3000"/> --stomper
           <item id="2470" chance="10000"/> --golden legs
		<item id="8926" chance="100000"/> --demonwing axe
		<item id="2469" chance="100000"/> --dragon scale legs
		<item id="2523" chance="100000"/> --blessed shield
           <item id="8867" chance="4000"/> --dragon robe
           <item id="2421" chance="7000"/> --thuder hammer
		<item id="9971" countmax="100" chance="5000"/> --gold ingot
       <item id="1987" chance="100000"> --bag
           <inside>
					<item id="2506" chance="80000"/> --dragon scale helmet
                       <item id="8853" chance="100000"/> --iron bolter
                       <item id="8928" chance="50000"/> --obsidian trouchon
                       <item id="2195" chance="130000"/> --boots of haste
                       <item id="2437" chance="160000"/> --golden mace
                       <item id="2522" chance="7000"/> --great shield
                       <item id="2421" chance="7000"/> --thuder hammer
                       <item id="2514" chance="100000"/> --mastermind shield
					<item id="2646" chance="100000"/> --golden boots
					<item id="2421" chance="700"/> --thudner hammer
           </inside>
       </item>
   </loot>
</monster>

 

Bazir:

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Bazir" nameDescription="a bazir" race="fire" experience="30000" speed="280" manacost="0">
<health now="100000" max="100000"/>
<look type="35" corpse="5995"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="0"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="0"/>
   <flag convinceable="0"/>
   <flag pushable="0"/>
   <flag canpushitems="1"/>
   <flag canpushcreatures="1"/>
   <flag staticattack="85"/>
   <flag targetdistance="1"/>
   <flag runonhealth="0"/>
 </flags>
<attacks>
   <attack name="melee" interval="2000" target="5" min="0" max="-2700"/>
   <attack name="fire" interval="1000" chance="13" range="7" radius="6" target="1" min="-2000" max="-3000">
       <attribute key="shootEffect" value="fire"/>
       <attribute key="areaEffect" value="firearea"/>
   </attack>
   <attack name="poisoncondition" interval="1000" chance="13" radius="6" target="1" min="-1500" max="-3000">
       <attribute key="areaEffect" value="poison"/>
   </attack>
<attack name="speed" interval="1000" chance="30" range="7" duration="12000" speedchange="0">
		<attribute key="areaEffect" value="redshimmer"/>
		<item type="2317"/>
	</attack>
<attack name="lifedrain" interval="1000" chance="13" radius="5" target="0" min="-2000" max="-3000">
		<attribute key="areaEffect" value="watersplash"/>
	</attack>
   <attack name="speed" interval="10000" chance="25" target="1" speedchange="-2000" duration="5000">
       <attribute key="areaEffect" value="redshimmer"/>
   </attack>
	<attack name="drunk" interval="10000" chance="2" range="6" radius="3">
		<attribute key="shootEffect" value="whirlwindclub"/>
		<attribute key="areaEffect" value="poff"/>
	</attack>
</attacks>
<defenses armor="70" defense="70">
	<defense name="invisible" interval="5000" chance="50" duration="10000">
		<attribute key="areaEffect" value="redshimmer"/>
	</defense>
	<defense name="speed" interval="3000" chance="30" speedchange="3000" duration="3000">
		<attribute key="areaEffect" value="redspark"/>
	</defense>
 </defenses>
   <elements>
       <element physicalPercent="0"/>
       <element icePercent="0"/>
       <element deathPercent="0"/>
   </elements>
 <immunities>
   <immunity energy="1"/>
   <immunity fire="1"/>
   <immunity poison="1"/>
   <immunity lifedrain="1"/>
   <immunity paralyze="1"/>
   <immunity invisible="1"/>
 </immunities>
 <summons maxSummons="1">
   <summon name="demon" interval="15000" chance="100"/>                        
 </summons>
 <voices interval="5000" chance="10">
   <voice sentence="COME HERE! FREE ITEMS FOR EVERYONE!" yell="1"/>
   <voice sentence="BOW TO THE POWER OF THE RUTHLESS SEVEN!"/>
   <voice sentence="Slay your friends and I will spare you!"/>
   <voice sentence="DON'T BE AFRAID! I AM COMING IN PEACE!" yell="1"/>
 </voices>
   <loot>
	<item id="5954" countmax="2" chance1="12000"/> --demon horn
           <item id="7421" chance="600"/> --onyx flail
           <item id="8881" chance="5000"/> --fireborn giantarmor
           <item id="2112" chance="1000"/> --teddy bear
           <item id="2472" chance="3000"/> --magic plate armor
           <item id="2123" chance="13000"/> --ring of the sky
           <item id="8929" chance="30000"/> --stomper
           <item id="6500" chance1="13000" countmax="100"/> --essence
           <item id="8886" chance="3000"/> --stomper
           <item id="8886" chance="2000"/> --molten plate
           <item id="2470" chance="10000"/> --golden legs
		<item id="8926" chance="100000"/> --demonwing axe
		<item id="2469" chance="100000"/> --dragon scale legs
		<item id="2523" chance="100000"/> --blessed shield
           <item id="8867" chance="4000"/> --dragon robe
           <item id="8865" chance="7000"/> --darklords cape
		<item id="9971" countmax="100" chance="5000"/> --gold ingot
       <item id="1987" chance="100000"> --bag
           <inside>
					<item id="2506" chance="80000"/> --dragon scale helmet
                       <item id="8853" chance="100000"/> --iron bolter
                       <item id="8928" chance="50000"/> --obsidian trouchon
                       <item id="2195" chance="130000"/> --boots of haste
                       <item id="2437" chance="160000"/> --golden mace
                       <item id="2522" chance="7000"/> --great shield
                       <item id="2421" chance="7000"/> --thuder hammer
                       <item id="2514" chance="100000"/> --mastermind shield
					<item id="2646" chance="100000"/> --golden boots
					<item id="2421" chance="700"/> --thudner hammer
           </inside>
       </item>
   </loot>
</monster>

 

Verminor:

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Verminor" nameDescription="a Verminor" race="venom" experience="80000" speed="1800" manacost="0">
<health now="160000" max="160000"/>
<look type="35" corpse="5995"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="0"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="0"/>
   <flag convinceable="0"/>
   <flag pushable="0"/>
   <flag canpushitems="1"/>
   <flag canpushcreatures="1"/>
   <flag staticattack="85"/>
   <flag targetdistance="1"/>
   <flag runonhealth="0"/>
 </flags>
<attacks>
   <attack name="melee" interval="2000" target="5" min="600" max="-1000"/>
   <attack name="poisonfield" interval="1000" chance="13" range="5" radius="7" target="1">
       <attribute key="shootEffect" value="poison"/>
       <attribute key="areaEffect" value="poison"/>
   </attack>
   <attack name="poisoncondition" interval="1000" chance="13" radius="6" target="1" min="-1500" max="-3000">
       <attribute key="areaEffect" value="poison"/>
   </attack>
<attack name="speed" interval="1000" chance="30" range="6" duration="5000" speedchange="-1000">
		<attribute key="areaEffect" value="poison"/>
	</attack>
	<attack name="melee" interval="3000" chance="15" range="7" radius="3" target="0" min="-1100" max="-2340">
		<attribute key="areaEffect" value="greenspark"/>
	</attack>
   <attack name="speed" interval="10000" chance="25" target="1" speedchange="-2000" duration="5000">
       <attribute key="areaEffect" value="redshimmer"/>
   </attack>
	<attack name="poison" interval="10000" chance="2" range="6" radius="3" min="-200" max="3340">
		<attribute key="shootEffect" value="poison"/>
		<attribute key="areaEffect" value="poison"/>
	</attack>
</attacks>
<defenses armor="70" defense="70">
 </defenses>
   <elements>
       <element physicalPercent="0"/>
       <element icePercent="0"/>
       <element deathPercent="0"/>
	<element earthPercent="100"/>
   </elements>
 <immunities>
   <immunity energy="1"/>
   <immunity fire="1"/>
   <immunity poison="1"/>
   <immunity lifedrain="1"/>
   <immunity paralyze="1"/>
   <immunity invisible="1"/>
 </immunities>
 <summons maxSummons="2">
   <summon name="demon" interval="15000" chance="100"/>                        
 </summons>
 <voices interval="5000" chance="10">
   <voice sentence="BOW TO THE POWER OF THE RUTHLESS SEVEN!"/>
 </voices>
   <loot>
	<item id="5954" countmax="2" chance1="12000"/> --demon horn
           <item id="7421" chance="600"/> --onyx flail
           <item id="8881" chance="5000"/> --fireborn giantarmor
           <item id="2112" chance="1000"/> --teddy bear
           <item id="2472" chance="3000"/> --magic plate armor
           <item id="2123" chance="13000"/> --ring of the sky
           <item id="8929" chance="30000"/> --stomper
           <item id="6500" chance1="13000" countmax="100"/> --essence
           <item id="8886" chance="3000"/> --stomper
           <item id="8886" chance="2000"/> --molten plate
           <item id="2470" chance="10000"/> --golden legs
		<item id="8926" chance="100000"/> --demonwing axe
		<item id="2469" chance="100000"/> --dragon scale legs
		<item id="2523" chance="100000"/> --blessed shield
           <item id="8867" chance="4000"/> --dragon robe
           <item id="8865" chance="7000"/> --darklords cape
		<item id="9971" countmax="100" chance="5000"/> --gold ingot
       <item id="1987" chance="100000"> --bag
           <inside>
					<item id="2506" chance="80000"/> --dragon scale helmet
                       <item id="8853" chance="100000"/> --iron bolter
                       <item id="8928" chance="50000"/> --obsidian trouchon
                       <item id="2195" chance="130000"/> --boots of haste
                       <item id="2437" chance="160000"/> --golden mace
                       <item id="2522" chance="7000"/> --great shield
                       <item id="2421" chance="7000"/> --thuder hammer
                       <item id="2514" chance="100000"/> --mastermind shield
					<item id="2646" chance="100000"/> --golden boots
					<item id="2421" chance="700"/> --thudner hammer
           </inside>
       </item>
   </loot>
</monster>

 

 

 

Skrypty nie moje znalezione w internecie temat będzie aktualizowany

1396292564-U784394.png
  • 2 miesiące temu...
Opublikowano

Skrypt do Kolorowych napisów na TP,items,itp..

 

w data/npc/scripts tworzymy efekciarz.lua i wklejamy tm to (skrpyt):

 

focus = 0 talk_start = 0 target = 0 following = false attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) end function onCreatureTurn(creature) end function onCreatureSay(cid, type, msg) end function onCreatureChangeOutfit(creature) end local gdzie = { co = {-- w tej tabeli podajemy podtabele z wyswietlanym tekstem i miejscem w ktorym ma sie wyswietlic {"Twoj Tekst", {x=współrzędne napisu, y=współrzędne napisu, z=współrzędne napisu}}, }, efekty = {0, 1, 2, 3, 12, 13, 14, 18, 19, 22, 26, 27, 28, 29, 30, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51}, -- efekty ktore pojawiaja sie na danym miejscu coile = 1.5 -- czas w sekundach miedzy pojawieniami sie efektow } function wyswietl(gdzie) for i=1, #gdzie.co do doSendAnimatedText(gdzie.co[2], gdzie.co[1], math.random(1, 254)) doSendMagicEffect(gdzie.co[2], gdzie.efekty[math.random(1, #gdzie.efekty)]) end addEvent(wyswietl,(gdzie.coile*1000),gdzie) efektstart = 1 end function onThink() if efektstart ~= 1 then addEvent(wyswietl,1,gdzie) end end

 

 

Twoj tekst-Teskst ktory ma wyskakiwac

Współrzędne napisu-Wpsółrzędne kratki na ktorej ma wyskakiwac napis (następne "Współrzędne napisu) to tez podajemy (Czyli ogulne wspolrzedne x= y= z=)

Pomogłem? daj1312648756-U375654.jpg

1313257728-U375654.jpg

Pomogłem? daj1312648756-U375654.jpg

1312648566-U375654.jpg+ 1313257978-U375654.jpg

  • 2 tygodnie później...
Opublikowano

Efekciarz nie dziala... Moglbys pomoc Alcharian w nim??

Posty - 25, 50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1300, 1500, 2000.

  • 3 miesiące temu...
Opublikowano

 

Pet System.
Oto nowy PetSystem. Różni się nieco od poprzedniego, ale główne motywy pozostają takie same.
UWAGA!
Wymagane jest posiadanie źródeł do naszego silnika (z ang. source) w celu ich kompilacji.

~~LUA~~
Zaczynamy w actions

Kod PHP:
local PET = {
	['dragon'] = {level = 45, id = 5941, percent_hp = 35, chance = 85, CONST_ME_MORTAREA}
	}
local max_summons = 1
local function checkSummons(cid)
local summon_list = {}
for _, v in ipairs(getCreatureSummons(cid)) do
table.insert(summon_list, v)
end
return summon_list
end  

function onUse(cid, item, fromPosition, itemEx, toPosition)
local s = (getItemAttribute(item.uid, 'specialDescription') or nil)
if isCreature(itemEx.uid) then
local v = PET[getCreatureName(itemEx.uid):lower()]
if v and item.itemid == v.id then
	if isInArray({'','nil'}, tostring(s)) then
		if #getCreatureSummons(cid) >= max_summons then
			return doSendMagicEffect(toPosition, CONST_ME_POFF) and doPlayerSendCancel(cid, 'Posiadasz już maksymalną ilość stworzeń.')
		end
		if getCreatureHealth(itemEx.uid) > v.percent_hp * (getCreatureMaxHealth(itemEx.uid) / 100) then
			return doSendMagicEffect(toPosition, CONST_ME_POFF) and doPlayerSendCancel(cid, 'Potwór ma o '..math.floor(getCreatureHealth(itemEx.uid) - ((getCreatureMaxHealth(itemEx.uid) / 100) * v.percent_hp))..' punktów życia za dużo.')
		end
		if getPlayerLevel(cid) < v.level then
			return doSendMagicEffect(toPosition, CONST_ME_POFF) and doPlayerSendCancel(cid, 'Twój poziom doświadczenia jest za niski.')
		end
		if math.random(100000) > v.chance * 1000 then
			doCreatureSay(cid, 'Niestety, nie udało Ci się złapać '..getCreatureName(itemEx.uid)..'.', TALKTYPE_ORANGE_1)
			doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'Nieststy, nie udało Ci się złapać '..getCreatureName(itemEx.uid)..'.')
			return doSendMagicEffect(toPosition, CONST_ME_POFF) and doRemoveItem(item.uid) and doRemoveCreature(itemEx.uid)
		end
			doItemSetAttribute(item.uid, 'aid', getCreatureMaxHealth(itemEx.uid))
			doItemSetAttribute(item.uid, 'description', 'W '..getItemName(item.uid)..' znajduje się - '..getCreatureName(itemEx.uid))
			doItemSetAttribute(item.uid, 'specialDescription', getCreatureName(itemEx.uid))
			doCreatureSay(cid, 'Gratulacje! Udało Ci się złapać '..getCreatureName(itemEx.uid)..'.', TALKTYPE_ORANGE_1)
			doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'Gratulacje! Udało Ci się złapać '..getCreatureName(itemEx.uid)..'.')
			return doSendMagicEffect(toPosition, v[1]) and doRemoveCreature(itemEx.uid)
	else
		if isInArray(checkSummons(cid), itemEx.uid) then
			if getCreatureMaster(itemEx.uid) ~= cid then
				return doSendMagicEffect(toPosition, CONST_ME_POFF) and doPlayerSendCancel(cid, 'Stworzenie nie należy do Ciebie.')
			end
			if getCreatureName(itemEx.uid):lower() == s:lower() and getCreatureStorage(itemEx.uid, 1000) == cid then
				doItemSetAttribute(item.uid, 'aid', getCreatureMaxHealth(itemEx.uid) - getCreatureHealth(itemEx.uid))
				doItemSetAttribute(item.uid, 'description', 'W '..getItemName(item.uid)..' znajduje się - '..getCreatureName(itemEx.uid)..'- posiadający '..getCreatureStorage(itemEx.uid, 1001)..' poziom.')
				return doSendMagicEffect(toPosition, v[1]) and doRemoveCreature(itemEx.uid)
			end
		end
	end
else
	doSendMagicEffect(fromPosition, CONST_ME_POFF)
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'Niemożliwe.')
end
elseif isInArray({'','nil'}, tostring(s)) == false then
local v, desc = PET[s:lower()], (getItemAttribute(item.uid, 'description') or ''):explode(' ')
if v and desc[1]:lower() == 'w' then
	local m = doCreateMonster(s:lower(), toPosition)
	doCreatureSetStorage(m, 1000, cid)
	doCreatureAddHealth(m, getCreatureMaxHealth(m) - item.actionid)
	doItemSetAttribute(item.uid, 'description', getCreatureName(m)..' jest aktualnie poza '..getItemName(item.uid))
	return doSendMagicEffect(toPosition, v[1]) and doConvinceCreature(cid, m)
end
end
return true
end
Kod PHP:
<action itemid="5941" event="script" value="pet.lua"/>
Creatureevent

Kod PHP:
local levels = {100,200,400,800,1500,2600,4200,6400,9300,13000,17600,23200,29900,37800,47000,57600,69700,83400,98800,116000,135100,156200,179400,204800,232500,262600,295200,330400,368300,409000,452600,499200,548900,601800,658000,717600,780700,847400,917800,992000}
local rate = 1
local monsters = {'dragon','bug'}
function onThink(cid, interval)
if isMonster(cid) and isInArray(monsters, getCreatureName(cid):lower()) then
if getCreatureStorage(cid, 1001) == -1 then doCreatureSetStorage(cid, 1001, 0) end
local exp = getCreatureStorage(cid, 1002)
for i = 1, #levels do
	if exp * rate >= levels[i] and getCreatureStorage(cid, 1001) < i then
		doCreatureSetStorage(cid, 1001, i)
		return doPlayerSendTextMessage(getCreatureMaster(cid), MESSAGE_INFO_DESCR, 'Twój '..getCreatureName(cid)..' awansował na poziom '..i)
	end
end
end
return true
end
Kod PHP:
<event type="think" name="Pet_system" event="script" value="pet_system.lua"/>
Do każdego monstera, którego można złapać dodajemy:

Kod PHP:
<script>
  <event name="Pet_system"/>
</script>
Kod PHP:
PET = {
	['yuan ti'] = {level = 45, id = 5941, percent_hp = 35, chance = 85, CONST_ME_MORTAREA}
	}
function onLogout(cid)
if #getCreatureSummons(cid) >= 1 then
for _, v in ipairs(getCreatureSummons(cid)) do
	if getCreatureStorage(v, 1000) == cid and PET[getCreatureName(v):lower()] then
		if doPlayerRemoveItem(cid, PET[getCreatureName(v):lower()].id, 1) then
			local item = doPlayerAddItem(cid, PET[getCreatureName(v):lower()].id, 1)
			doItemSetAttribute(item, 'aid', getCreatureMaxHealth(v) - getCreatureHealth(v))
			doItemSetAttribute(item, 'description', 'W '..PET[getCreatureName(v):lower()].id..' znajduje się - '..getCreatureName(v)..'- posiadający '..getCreatureStorage(v, 1001)..' poziom.')
			doItemSetAttribute(item, 'specialDescription', getCreatureName(v):lower())
			doItemSetAttribute(item, 'vitality', getCreatureStorage(v, 1001))
			break
		end
	end
end
end
return true
end
Kod PHP:
<event type="logout" name="PlayerLogout" event="script" value="logout.lua"/>
Kod PHP:
registerCreatureEvent(cid, 'PlayerLogout')
~~C++~~
Otwieramy creature.cpp i szukamy:

Kod PHP:
void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied)
Usuwamy cały blok funkcji i na jego miejsce wklejamy:

Kod PHP:
void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied)
{
if(gainExp <= 0)
	return;
if(master)
{
	gainExp = gainExp / 2;
	master->onGainExperience(gainExp, fromMonster, multiplied);
}
else if(!multiplied)
	gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE);
int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR);
if(color < 0)
	color = random_range(0, 255);
std::string strValue;
getStorage(1002, strValue);
double i = atoi(strValue.c_str()) + gainExp;
std::ostringstream sa;
sa << i;
std::string value = sa.str();
setStorage(1002, value);
std::stringstream ss;
ss << (uint64_t)gainExp;
g_game.addAnimatedText(getPosition(), (uint8_t)color, ss.str());
}
Otwieramy monsters.cpp i szukamy

Kod PHP:
canPushItems = pushable = canPushCreatures = isIllusionable = isLureable = isWalkable = hideName = isConvinceable = hideHealth = false;
isAttackable = isSummonable = isHostile = true;
Podmieniamy z:

Kod PHP:
canPushItems = pushable = canPushCreatures = isIllusionable = isLureable = isWalkable = hideName = hideHealth = false;
isAttackable = isSummonable = isConvinceable = isHostile = true;
Otwieramy monster.cpp i szukamy:

Kod PHP:
void Monster::doAttacking(uint32_t interval)
Usuwamy cały blok funkcji i na jej miejsce wklejamy:

Kod PHP:
void Monster::doAttacking(uint32_t interval)
{
if(!attackedCreature || (isSummon() && attackedCreature == this))
	return;
bool updateLook = true, outOfRange = true;
resetTicks = interval;
attackTicks += interval;
const Position& myPos = getPosition();
const Position& targetPos = attackedCreature->getPosition();
for(SpellList::iterator it = mType->spellAttackList.begin(); it != mType->spellAttackList.end(); ++it)
{
	if(it->isMelee && isFleeing())
		continue;
	bool inRange = false;
	if(canUseSpell(myPos, targetPos, *it, interval, inRange))
	{
		if(it->chance >= (uint32_t)random_range(1, 100))
		{
			if(updateLook)
			{
				updateLookDirection();
				updateLook = false;
			}
			double multiplier;
			if(maxCombatValue > 0) //defense
				multiplier = g_config.getDouble(ConfigManager::RATE_MONSTER_DEFENSE);
			else //attack
				multiplier = g_config.getDouble(ConfigManager::RATE_MONSTER_ATTACK);
			std::string strValue;
			getStorage(1001, strValue);
			int min = (int32_t)(it->minCombatValue * multiplier) - (atoi(strValue.c_str()) * 3);
			int max = (int32_t)(it->maxCombatValue * multiplier) - (atoi(strValue.c_str()) * 3);

			minCombatValue = min;
			maxCombatValue = max;
			it->spell->castSpell(this, attackedCreature);
			if(it->isMelee)
				extraMeleeAttack = false;
#ifdef __DEBUG__
			static uint64_t prevTicks = OTSYS_TIME();
			std::cout << "doAttacking ticks: " << OTSYS_TIME() - prevTicks << std::endl;
			prevTicks = OTSYS_TIME();
#endif
		}
	}
	if(inRange)
		outOfRange = false;
	else if(it->isMelee) //melee swing out of reach
		extraMeleeAttack = true;
}
if(updateLook)
	updateLookDirection();
if(resetTicks)
	attackTicks = 0;
}
Szukamy:

Kod PHP:
health = (int32_t)(mType->health * multiplier * rates / 100);
healthMax = (int32_t)(mType->healthMax * multiplier * rates / 100);
I zamieniamy z:

Kod PHP:
std::string strValue;
getStorage(1001, strValue);
int lev = atoi(strValue.c_str()) * 100;
health = (int32_t)(mType->health * multiplier + lev);
healthMax = (int32_t)(mType->healthMax * multiplier + lev);
Szukamy:

Kod PHP:
baseSpeed = mType->baseSpeed;
I zamieniamy na:

Kod PHP:
baseSpeed = mType->baseSpeed + (atoi(strValue.c_str()) * 2);

 

 

Skrypt NIE MÓJ ja go tu tylko wstawiłem.

 

 

Co do skrytów nie za specjalne.

  • 2 miesiące temu...
  • 2 lata później...
Opublikowano

Gdzie to sie daje te skrypty?

1361565342-U334301.png


By Maxiu


-----------------------------------------------------------------------------------------------------


 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...