KA
action

[TFS 1.x] Tron Event [V0.5]

Por kaleudd, 21 de jan. de 2016 em Mods, funções e outros

4
2k
21 de janeiro de 2016 às 12:13

Author:Printer

 

Como funciona:

 

giphy.gif

 

Instalação:

Vá em actions/actions.xml e adicione essa linha:

<action actionid="8000" script="tronEventLever.lua" />

Vá em actions/scripts e crie um arquivo chamado ''tronEventLever.lua'' e adicione isso dentro:

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1945 then
        if tronEvent:onUseLever(player) == false then
            return true
        end
    end

    item:transform(item.itemid == 1945 and 1946 or 1945)
    return true
end

Agora vá em movements/movements.xml e remova essas linhas:

    <movevent event="AddItem" itemid="1492" function="onAddField" />
    <movevent event="StepIn" itemid="1493" function="onStepInField" />
    <movevent event="StepIn" itemid="1500" function="onStepInField" />
    <movevent event="AddItem" itemid="1500" function="onAddField" />
    <movevent event="StepIn" itemid="1506" function="onStepInField" />
    <movevent event="AddItem" itemid="1506" function="onAddField" />

E adicione essas linhas:

    <movevent event="StepIn" itemid="1492" script="tronEventMovement.lua" />
    <movevent event="StepIn" itemid="1500" script="tronEventMovement.lua" />
    <movevent event="StepIn" itemid="1506" script="tronEventMovement.lua" />

Vá em movements/scripts e crie um arquivo chamado "tronEventMovement.lua" e adicione isso dentro:

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if player == nil then
        return false
    end

    position:sendMagicEffect(CONST_ME_FIREAREA)
    tronEvent:onPlayerDeath(player, tonumber(item:getAttribute(ITEM_ATTRIBUTE_TEXT)) or 0)
    return true
end

Agora em data/global.lua,adicione essa linha:

dofile('data/tronEvent.lua')

Create new lua inside data folder and name it: "tronEvent.lua" and paste this:
http://pastebin.com/qdjptfYe

2 semanas depois...
SirarckenS
31 de janeiro de 2016 às 11:01

Esse funciona so para 1.0 né?

31 de janeiro de 2016 às 11:08

1.0,1.1 e 1.2.

AdministradorA
01 de fevereiro de 2016 às 10:59

Criativo de mais, e divertido hahaha

Curti muito, obrigado por postar :)