What's new

Spells Transform System TFS

Status
Not open for further replies.

Sonpabo

Active User
Joined
Jun 29, 2009
Messages
71
Reaction score
6
Witam napisa?em skrypt na Transform i chce sie z wami nim podzieli?
Autor:pabo

transform.lua
PHP:
local Konfiguracja = {

[1] = {profesja = 2, level = 50, wyglad = 342, efekt = 15, maxhp = 300, maxmana = 300,  text = "Transform"},
[2] = {profesja = 3, level = 100, wyglad = 343, efekt = 16, maxhp = 500, maxmana = 500,  text = "Transform"}
}

function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]



if(config) then 
    if getPlayerLevel(cid) >= config.level then

        doCreatureChangeOutfit(cid,config.wyglad)
        doPlayerSetVocation(cid,config.profesja)    
        doSendMagicEffect(getCreaturePosition(cid),config.efekt)
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
        setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)
    

else
    doPlayerSendCancel(cid, "Transform - "..config.level.." for "..config.text.." .")
end


else
doPlayerSendCancel(cid,"You Cannot Transform.")
end

end

Wyja?nienie :
PHP:
[voc przed transem] = {profesja = na jaki zmienia, level = wymagany lvl, wyglad = jak ma postac wyglodac, efekt = efekt przy trasie, maxhp = bonushp, maxmana = bonusmany,  text = "Napis"}

revert.lua
PHP:
local Konfiguracja  = {

[2] = {profesja = 1, nowy_wyglad = 342, maxhp =-300, maxmana= -300, efekt = 15},
[3] = {profesja = 1, wyglad = 342, maxhp =-500, maxmana = -500, efekt = 15}
}

function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]



if(config) then 

        doCreatureChangeOutfit(cid,config.wyglad)
        doPlayerSetVocation(cid,config.profesja)    
        doSendMagicEffect(getPlayerPosition(cid),config.efekt)
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
        setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)

else
doPlayerSendCancel(cid,"Normal State.")
end

end

login.lua
PHP:
function onLogin(cid)

local Konfiguracja = { 

[1] = {profesja = 2, maxhp = -300, maxmana = -300},
}

function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]

if(config) then 
    doPlayerSetVocation(cid,config.profesja)    
                    doSendMagicEffect(getCreaturePosition(cid),config.efekt)
                    setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
                    setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)

end    

end

Lub

PHP:
function onLogin(cid)
if (getPlayerVocation(cid) == 2) then 
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doPlayerAddMana(cid, getPlayerMaxMana(cid))
        doPlayerSetVocation(cid, 1) 
        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 300)
        setCreatureMaxMana(cid, getPlayerMaxMana(cid) - 300)
 

TenTypSwir

NNSTORY.EU Developer
Joined
Jun 8, 2010
Messages
1,657
Reaction score
117
Odp: Transform System TFS

Skrypt z?y nie jest ale widzia?em lepsze :p Wiesz mozesz tez dodac np efekt co x sec [do konfigu], bonusy speeda czy cos nwm ;s rozwin skrypt bo duzo juz ich jest ;>
 

Sonpabo

Active User
Joined
Jun 29, 2009
Messages
71
Reaction score
6
Odp: Transform System TFS

To raczej nie potrzebne. Ustawiamy sile itp: w vacations doda?em bonus trans bo to jest przydatne...

Efekty mo?na zrobi? w Creaturescripts
 
Status
Not open for further replies.
Top