Ogłoszenie

Serwer rusza ponownie z nowymi aktualizacjami!
Postęp prac: 15%

#1 2008-12-31 15:04:18

Gribi

Użytkownik

Zarejestrowany: 2008-12-31
Posty: 11
Punktów :   

Skrypt na Transform

O to skrypt na transform.
Dałem wcześniej inny ale nie dzialal może ten podziała;]

Kod:

-- Transform by Dram.
function onSay(cid, words, param)
-- Witam, napisalem skrypt na transform. Dzieki temu skryptu mozemy.
-- Ustawic minimum many ktora trzeba posiadac
-- Ustawic minimalny level.
-- Ustawic w jaka voc sie zamienia.
-- Czy dla pacca czy nie dla pacca.
-- Zmiana outfitu w.

------------------------------ustawienia---------------
local mana = 100 -- Minimum many.
local voce = 1 -- Dla jakiej profesji?
local lvl = 30 -- Minimalny level.
local voc = 9 -- W jaka voc zmienia.
local pacc = 0 -- 1=pacc wymagany 0= nie.
local pacce = 1 -- Jezeli dla pacca to ustawiamy tu tez 1 ,a jak nie to ustawiamy 0. pacc,pacce musza byc przeciwne. Np. pacc = 1 pacce = 1. Dlatego ze dla pacc. pacc=0 pacce = 1. Dlatego ze nie dla pacca.
local outfit = {lookType=75,lookHead=0,lookAddons=0,lookLegs=0,lo okBody=0,lookFeet=0} -- Zmiana outfitu w id?
local outfitTime = 9000000 -- Ustawiamy na maxa tak zeby byl outfit caly czas.
local napis = "Aaaah" -- Jaki napis sie ma pojawic w nawiasie.
local effekt = 12 -- Jaki effekt ma sie pojawic.
--------------------------------koniec ustawien---------
----------------------kod-----------------------------
if(getPlayerMana(cid) >= mana and getPlayerVocation(cid) == voce and getPlayerLevel(cid) >= lvl and isPremium(cid) == pacc or isPremium(cid) == pacce and getPlayerVocation(cid) < voc )then
setPlayerStorageValue(cid,5,getPlayerVocation(cid) )
doPlayerSetVocation(cid,voc)
doPlayerAddMana(cid,-mana)
doSetCreatureOutfit(cid, outfit, outfitTime)
doPlayerSay(cid,napis,16)
local pos = getPlayerPosition(cid)
doSendMagicEffect(pos,effekt)
setPlayerStorageValue(cid,312,1)
else
doPlayerSendCancel(cid,"Dostosuj sie do wymagan.")
end
return 1
end

Offline

 

#2 2008-12-31 15:28:18

InVenTuS

*Admineq*

Zarejestrowany: 2008-12-31
Posty: 16
Punktów :   

Re: Skrypt na Transform

Przykro mi ale ten skrypt nie dziala.

Offline

 

#3 2008-12-31 15:39:35

Gribi

Użytkownik

Zarejestrowany: 2008-12-31
Posty: 11
Punktów :   

Re: Skrypt na Transform

Skrypt by: Piotrek1447
Info:
playerVocation - tutaj wstawiasz ID profesji które mogą tego użyć
playerNewVocation - ID nowej profesji w którą się transformujesz
playerNewLookType - ID nowego outfitu
playerLevel - wymagany level
manaCost - wymagana ilość many
soulCost - wymagana ilość souli
timeActive - czas działania w sekundach
Installation:
Do Talkaction.xml dodajesz:

Kod:

<talkaction words="!transform" script="transform.lua"/>

Folder data/talkaction/scripts/tranform.lua

Kod:

-- Transformation System by Piotrek1447
local configuration =
{
playerVocation = {1, 2, 5, 6},
playerNewVocation = 9,
playerNewLookType = 12,
playerLevel = 10,
manaCost = 100,
soulCost = 2,
timeActive = 10
}
local VOCATION_STORAGE = 10000
local outfit = {lookType = configuration.playerNewLookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0}
function onSay(cid, words, param)
if(isInArray(configuration.playerVocation, getPlayerVocation(cid)) == TRUE) then
if(getPlayerLevel(cid) >= configuration.playerLevel) then
if(getPlayerMana(cid) >= configuration.manaCost) then
if(getPlayerSoul(cid) >= configuration.soulCost) then
setPlayerStorageValue(cid, VOCATION_STORAGE, getPlayerVocation(cid))
doPlayerSetVocation(cid, configuration.playerNewVocation)
doPlayerAddMana(cid, - configuration.manaCost)
doPlayerAddSoul(cid, - configuration.soulCost)
doSetCreatureOutfit(cid, outfit, configuration.timeActive * 1000)
addEvent(transformBack, configuration.timeActive * 1000, cid)
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required soul points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required mana points.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required level.")
end
else
doPlayerSendCancel(cid, "Sorry, you don\'t have required vocation.")
end
end
function transformBack(cid)
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end

W creaturescritps/scripts podmień login.lua na to:

Kod:

local VOCATION_STORAGE = 10000
function onLogin(cid)
if(getPlayerStorageValue(cid, VOCATION_STORAGE) > 0) then
doPlayerSetVocation(cid, getPlayerStorageValue(cid, VOCATION_STORAGE))
setPlayerStorageValue(cid, VOCATION_STORAGE, 0)
end
return TRUE
end

Offline

 

#4 2008-12-31 16:02:42

SP33D

*Admineq*

Zarejestrowany: 2008-12-30
Posty: 37
Punktów :   

Re: Skrypt na Transform

Okej dzięki.. zobaczymy co tam InV wymyśli

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
GotLink.plkurs projektowania wnętrz przeprowadzki Mrągowo apartamenty