Reklama
Pokazuje wyniki od 1 do 6 z 6

Temat: [8.10][Actions] Manarune by Cro

  1. #1

    Notoryczny Miotacz Postów Cro jest teraz offline
    Avatar Cro
    Data rejestracji
    2010
    Położenie
    Aokigahara
    Wiek
    29
    Posty
    1,123
    Siła reputacji
    15

    Domyślny [8.10][Actions] Manarune by Cro

    Nieśmiertelna manaruna Killavus'a "lekko" przerobiona przeze mnie ;d

    manarune.lua
    Kod PHP:
    local config = {
    	exhaustTime = 1,
    	exhaustStorageId = 15435
    	}
    	
    function onUse(cid, item, frompos, item2, topos)
    	local lvl, mlvl = getPlayerLevel(cid), getPlayerMagLevel(cid)
    	
    	-- formula settings
    	local manaMin = (lvl * 3.0) + (mlvl * 3.0)
    	local manaMax = (lvl * 3.0) + (mlvl * 5.0)
    	
    	-- the rest of the script, don't edit if you don't know what are you doing
    	local manaAdd = math.random(manaMin, manaMax)
    	
    	if(os.time() <= getPlayerStorageValue(cid, config.exhaustStorageId)) then
    		doSendMagicEffect(frompos, CONST_ME_POFF)
    		doPlayerSendCancel(cid, "You are exhausted.")
    		return 1
    	end
    	
    	if(isPlayer(item2.uid) == 1) then
    		doSendMagicEffect(topos, 30)
    		doSendAnimatedText(getPlayerPosition(cid), manaAdd, TEXTCOLOR_PURPLE)
    		doPlayerAddMana(item2.uid, manaAdd)
    		setPlayerStorageValue(cid, config.exhaustStorageId, os.time() + config.exhaustTime)
    	else
    		doSendMagicEffect(frompos, CONST_ME_POFF)
    		doPlayerSendCancel(cid, "You may use this rune only on players.")
    	end
    	
    	if(item.type > 1) then
    		doChangeTypeItem(item.uid, item.type - 1)
    	else
    		doRemoveItem(item.uid, 1)
    	end
    	
    end
    Actions.xml
    Kod PHP:
    <action itemid="2270" script="manarune.lua" />

  2. #2
    Avatar Palado
    Data rejestracji
    2007
    Położenie
    51.770N 19.459E
    Posty
    149
    Siła reputacji
    17

    Domyślny

    Napisałbyś, co zmieniłeś. -.^

  3. Reklama
  4. #3

    Notoryczny Miotacz Postów Cro jest teraz offline
    Avatar Cro
    Data rejestracji
    2010
    Położenie
    Aokigahara
    Wiek
    29
    Posty
    1,123
    Siła reputacji
    15

    Domyślny

    Okulary potrzebne?;o

    Stary skrypt: 59 linijek
    Kod:
    function onUse(cid, item, frompos, item2, topos)
    
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
    
    -- Exhausted Settings --
    local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
    local exhausted_storagevalue = 7000 -- Storage Value to store exhaust. It MUST be unused! --
    -- Exhausted Settings END --
    
    -- Mana Formula Settings --
    -- You can use "level" and "mlevel" --
    local mana_minimum = (level * 3) + (mlevel * 5) - 50
    local mana_maximum = (level * 3) + (mlevel * 5)
    -- Mana Formula Settings END --
    
    local mana_add = math.random(mana_minimum, mana_maximum)
    
    -- We check the charges. --
    if(item.type > 1) then
    -- Exhausted check. --
    if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
    -- Entity is player? --
    if(isPlayer(item2.uid) == 1) then
    doSendMagicEffect(topos,28)
    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
    doPlayerSay(cid,"Mana UUPP!!!",1)
    doPlayerAddMana(item2.uid, mana_add)
    setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
    else
    doSendMagicEffect(frompos, CONST_ME_POFF)
    doPlayerSendCancel(cid, "You can use this rune only on players.")
    end
    else
    doSendMagicEffect(frompos, CONST_ME_POFF)
    doPlayerSendCancel(cid, "You are exhausted.")
    end
    else
    if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
    doSendMagicEffect(frompos, CONST_ME_POFF)
    doPlayerSendCancel(cid, "You are exhausted.")
    else
    if(isPlayer(item2.uid) == 1) then
    doSendMagicEffect(topos,28)
    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
    doPlayerSay(cid,"GoGo Mana!",1)
    doPlayerAddMana(item2.uid, mana_add)
    setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
    else
    doSendMagicEffect(frompos, CONST_ME_POFF)
    doPlayerSendCancel(cid, "Ta rune mozesz uzywac tylko na graczach.")
    end
    end
    end
    
    return 1
    end
    Nowy: 38 linijek + konfiguracja na górze skryptu
    Kod:
    local config = {
        exhaustTime = 1,
        exhaustStorageId = 15435
        }
        
    function onUse(cid, item, frompos, item2, topos)
        local lvl, mlvl = getPlayerLevel(cid), getPlayerMagLevel(cid)
        
        -- formula settings
        local manaMin = (lvl * 3.0) + (mlvl * 3.0)
        local manaMax = (lvl * 3.0) + (mlvl * 5.0)
        
        -- the rest of the script, don't edit if you don't know what are you doing
        local manaAdd = math.random(manaMin, manaMax)
        
        if(os.time() <= getPlayerStorageValue(cid, config.exhaustStorageId)) then
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted.")
            return 1
        end
        
        if(isPlayer(item2.uid) == 1) then
            doSendMagicEffect(topos, 30)
            doSendAnimatedText(getPlayerPosition(cid), manaAdd, TEXTCOLOR_PURPLE)
            doPlayerAddMana(item2.uid, manaAdd)
            setPlayerStorageValue(cid, config.exhaustStorageId, os.time() + config.exhaustTime)
        else
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You may use this rune only on players.")
        end
        
        if(item.type > 1) then
            doChangeTypeItem(item.uid, item.type - 1)
        else
            doRemoveItem(item.uid, 1)
        end
        
    end

  5. #4
    Uzzio

    Domyślny

    Skrypt na manarune, jak każdy... Tylko w tym jak widać jest więcej linijek niż w innych (mających max 10). Widzę zastosowanie tablic i ogólnie newbie sobie poradzi z ogarnięciem tego skryptu (mowa o konfiguracji na górze). Nieźle.

  6. #5

    Notoryczny Miotacz Postów Cro jest teraz offline
    Avatar Cro
    Data rejestracji
    2010
    Położenie
    Aokigahara
    Wiek
    29
    Posty
    1,123
    Siła reputacji
    15

    Domyślny

    10 linjek?

    Kod:
    function onUse(...)
        if isPlayer(item2.uid) == true then
            doPlayerAddMana(cid, math.random(100, 300))
            doSendMagicEffect(topos, 14)
        else
            doPlayerSendCancel(cid, 'You may use this item only on players.')
            doSendMagicEffect(topos, 2)
        end
        doRemoveItem(item.uid, 1)
    end
    Chyba nie wiesz co mówisz, w czymś takim nawet nie wciśniesz exhausta ani formułek...

    #down
    A ok rozumiem ^^
    Pjona
    Ostatnio zmieniony przez Cro : 18-01-2011, 23:06

  7. #6
    Uzzio

    Domyślny

    #up
    Miałem na myśli to że skrypt jest duży jak na mr, przypomniały mi się stare skrypty na mr, mające max 10 linijek. Proszę bardzo oto jeden z nich:
    Kod:
    function onUse(cid, item, frompos, item2, topos)
    doPlayerSay(cid,'Mana',16)
    doRemoveItem(item.uid,1)
    doPlayerAddMana(cid, xxx) 
    end

Reklama

Informacje o temacie

Użytkownicy przeglądający temat

Aktualnie 1 użytkowników przegląda ten temat. (0 użytkowników i 1 gości)

Podobne tematy

  1. [Galeria] Cro mappuje :D
    Przez Cro w dziale Mapping
    Odpowiedzi: 5
    Ostatni post: 12-06-2011, 02:25
  2. Odpowiedzi: 2
    Ostatni post: 24-12-2010, 13:05
  3. [8.1][Actions]Mega: Manarune, Suddend Death, Ultimate Healing
    Przez Xoregnes w dziale Skrypty i technika
    Odpowiedzi: 0
    Ostatni post: 24-11-2009, 16:15
  4. [7.92][Actions] Krzesło elektryczne
    Przez Smoczek Leon w dziale Skrypty i technika
    Odpowiedzi: 158
    Ostatni post: 30-06-2009, 23:03
  5. Odpowiedzi: 13
    Ostatni post: 15-06-2009, 17:23

Zakładki

Zakładki

Zasady postowania

  • Nie możesz pisać nowych tematów
  • Nie możesz pisać postów
  • Nie możesz używać załączników
  • Nie możesz edytować swoich postów
  •