What's new

Support - pomoc przy pisaniu skrypt?w

Status
Not open for further replies.

wisnia_pl

User
Joined
Jun 8, 2008
Messages
35
Reaction score
1
Odp: Support - pomoc przy pisaniu skrypt?w

Pomo?e kto? w tym skrypcie bo nie mog? znale?? b??du
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 86400000)
addOutfitCondition(condition, 0, 71, 0, 0, 0, 0)
setCombatCondition(combat, condition)



vegeta = {lookType=332}

krilan = {lookType=331}

brolly = {lookType=334}

tsuful = {lookType=335}

piccolo = {lookType=336}

buu = {lookType=338}

cell = {lookType=339}

dende = {lookType=340}

goku = {lookType=277}

ext = 1000

---Goku---
function goku(cid)
if getPlayerVocation(cid) == 206 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(goku,ext,cid)
end
end
end
---Goku--

---Vegeta---
function vegeta(cid)
if getPlayerVocation(cid) == 219 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(vegeta,ext,cid)
end
end
end
---Vegeta---

---Brolly---
function brolly(cid)
if getPlayerVocation(cid) == 64 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(brolly,ext,cid)
end
end
end
---Brolly---

---Tsuful---
function tsuful(cid)
if getPlayerVocation(cid) == 246 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(tsuful,ext,cid)
end
end
end
---Tsuful---

---Piccolo---
function piccolo(cid)
if getPlayerVocation(cid) == 241 then
doSendMagicEffect(getPlayerPosition(cid), 26)
addEvent(piccolo,ext,cid)
end
end
end
---Piccolo---

---Buu---
function buu(cid)
if getPlayerVocation(cid) == 252 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(buu,ext,cid)
end
end
end
---Buu---

---Cell---
function cell(cid)
if getPlayerVocation(cid) == 279 then
doSendMagicEffect(getPlayerPosition(cid), 14)
addEvent(cell,ext,cid)
end
end
end
---Cell---

---Dende---
function dende(cid)
if getPlayerVocation(cid) == 302 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(dende,ext,cid)
end
end
end
---Dende---

---Krilan---
function krilan(cid)
if getPlayerVocation(cid) == 341 then
doSendMagicEffect(getPlayerPosition(cid), 180)
addEvent(krilan,ext,cid)
end
end
end
---Krilan---


function onCastSpell(cid, var)


---goku---

if getPlayerVocation(cid) == 206 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,341)
doSetCreatureOutfit(cid, goku, -1)
addEvent(goku,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 229)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---goku---

---vegeta---

elseif getPlayerVocation(cid) == 219 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,354)
addEvent(vegeta,ext,cid)
doSendMagicEffect(getPlayerPosition(cid), 229)
doSetCreatureOutfit(cid, vegeta, -1)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end

---vegeta---

---brolly---
elseif getPlayerVocation(cid) == 64 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,355)
addEvent(brolly,ext,cid)
doSetCreatureOutfit(cid, brolly, -1)
doSendMagicEffect(getPlayerPosition(cid), 233)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---brolly---

---tsuful---
elseif getPlayerVocation(cid) == 246 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,357)
addEvent(tsuful,ext,cid)
doSetCreatureOutfit(cid, tsuful, -1)
doSendMagicEffect(getPlayerPosition(cid), 233)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---tsuful---

--- piccolo---
elseif getPlayerVocation(cid) == 241 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,356)
addEvent(piccolo,ext,cid)
doSetCreatureOutfit(cid, piccolo, -1)
doSendMagicEffect(getPlayerPosition(cid), 233)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
--- piccolo---

---buu---
elseif getPlayerVocation(cid) == 252 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,358)
addEvent(buu,ext,cid)
doSetCreatureOutfit(cid, buu, -1)
doSendMagicEffect(getPlayerPosition(cid), 82)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---buu---

---cell---
elseif getPlayerVocation(cid) == 279 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,359)
addEvent(cell,ext,cid)
doSetCreatureOutfit(cid, cell, -1)
doSendMagicEffect(getPlayerPosition(cid), 233)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---cell---

---dende---
elseif getPlayerVocation(cid) == 302 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,360)
addEvent(dende,ext,cid)
doSetCreatureOutfit(cid, dende, -1)
doSendMagicEffect(getPlayerPosition(cid), 233)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---dende---

---krilan---
elseif getPlayerVocation(cid) == 353 then
if getPlayerLevel(cid) >= 350 then
doPlayerSetVocation(cid,361)
addEvent(krilan,ext,cid)
doSetCreatureOutfit(cid, krilan, -1)
doSendMagicEffect(getPlayerPosition(cid), 229)
else
doPlayerSendCancel(cid, "You need 350 level to Power transform")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
---krilan---
end
if
doPlayerSendCancel(cid, "You cannot transform.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
 
Last edited:

Syldock

Active User
Joined
May 9, 2008
Messages
146
Reaction score
4
[8.10]

[8.10]

Siemka. Mam do was wielk? pro?b?.
Chcia?em stworzy? pewnego npc. No i uda?o si? ale nie do ko?ca.
Konsola nie wskazuje ?adnych bug?w w skrypcie.
Ale NPC w ?aden spos?b nie reaguje na to co si? do niego napisze. Wiecie mo?e dlaczego ? NPC ten sprzedaje food i mo?na dosta? od niego misje. Tibia 8.10 prosz? was o pomoc.

Tutaj tre?? skryptu:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good Luck.')
focus = 0
talk_start = 0
end
end


function onCreatureTurn(creature)

end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)

if (msgcontains(msg, 'Hail') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. getCreatureName(cid) .. '! Do you want to buy food?.')
focus = cid
talk_start = os.clock()

elseif focus == cid then
talk_start = os.clock()

if msgcontains(msg, 'offer') then
selfSay('I sell dragon ham(10gp each) Brown mushrooms(10gp each) and Fire mushrooms(25gp each). Also I have a job for you')
elseif msgcontains(msg, 'dragon ham') or msgcontains(msg, 'dragon hams')then
buy(cid,2672,getCount(msg),10)
elseif msgcontains(msg, 'brown mushrooms') or msgcontains(msg, 'brown') then
buy(cid,2789,getCount(msg),10)
elseif msgcontains(msg, 'fire mushrooms') or msgcontains(msg, 'fire') then
buy(cid,2795,getCount(msg),25)
elseif msgcontains(msg, 'quest') then
selfSay('What s the matter??.')
elseif msgcontains(msg, 'help') then
if getPlayerStorageValue(cid,1091) == 3 then
selfSay('Already have done the task.')
else
if getPlayerStorageValue(cid,1091) == 2 then
if doPlayerRemoveItem(cid,2393,1) == 0 then
selfSay('You dont have my sword!')
else
selfSay('Ok thanks. You have this key to open next gate.')
doPlayerAddItem(cid,2088,1)
doItemSetAttribute(2088,"aid",5555)
setPlayerStorageValue(cid,1091,3)
end
else
if getPlayerStorageValue(cid,1091) <= 1 then
selfSay('Recently I went on the hunt. But the monster was too much and had to flee. In a panic I lost my sword. Could you get it back? know that the sword is carved by ancient giants. Maybe this will help you choose the sword. Hurry plx!')
setPlayerStorageValue(cid,1091,2)
end
end
end
elseif msgcontains(msg, 'bye')
and getDistanceToCreature(cid) < 4 then
selfSay('Good Luck, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Bye.')
focus = 0
end
end
end

Prosz? si? ze mnie nie ?mia? je?li co? jest ?le zrobione poniewa? nie znam si? na skryptach.
 

damierz

New User
Joined
Apr 5, 2009
Messages
1
Reaction score
0
Odp: Support - pomoc przy pisaniu skrypt?w

U mi mo?e kto? zrobi? skrypty do wodbo na nowe transformacje np. ssj5 vegeta.gohan.itp mam 1 skrypt na goku ssj5 pomorze kto?



moje gg 11968206



z g?ry dzieki :)
 
Joined
Sep 11, 2010
Messages
10
Reaction score
1
Odp: Support - pomoc przy pisaniu skrypt?w

Witajcie.
Silnik TFS 0.3.6 pod 8.54
Potrzebuje pomocy w napisaniu skryptu na "kratk?", kt?ra teleportuje po kilku sekundach. Niestety kompletnie nie wiem jak u?ywac event?w:
PHP:
local cfg = {
pos = {x=1321, y=1057, z=7}, -- gdzie ma teleportowac
text = "Time to next step! Go!",  -- co powie przy tp
aidpodlog = 2059,2060,2061,2062,
}
function onStepIn(cid, item, pos)
if (item.actionid == cfg.aidpodlog) then
<<---Tutaj funkcja, kt?rej nie znam, przenosz?ca mnie po np. 3 sekundach--->>
doTeleportThing(cid, cfg.pos)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GROUNDSHAKER)
doPlayerSendTextMessage(cid, 21, cfg.text)
end
return true
end
Czy kto? m?g?by mi wyt?umaczyc jak dodac do tego event? :)
 
Last edited:
Z

Zbizu

Guest
Odp: Support - pomoc przy pisaniu skrypt?w

Chodzi mi o zrobienie czego? takiego jak msg do kogo? w grze, ale tak, aby zamiast for your info wy?wietla? si? nick nadawcy i wiadomo?? w takim okienku:
pzpz.png

z dost?pno?ci? dla gm komend? /window Name, tekst
Nie wiem tylko jak to zrobi?.
PHP:
function onSay(cid, words, param)
    local needed_access = 3
    local msg = ""
    if getPlayerAccess(cid) >= needed_access then
        local player = getPlayerByName( param )
        if isPlayer( player ) == TRUE then
            doPlayerPopupFYI(( player ), "msg")
        else
            msg = "Gracz o nicku " .. param .. " nie jest zalogowany."
        end
    else
        doSendMagicEffect( getThingPos( cid ), CONST_ME_POFF )
        msg = "Nie masz wymaganych uprawnien, aby skorzystac z tej funkcji."
    end
    doPlayerSendTextMessage( cid, MESSAGE_EVENT_DEFAULT, msg )
    return TRUE
end
Domy?lam si?, ?e tutaj mog? uzyska? pomoc ;p
 
Last edited:

Ldrozd

Senior User
Joined
Nov 26, 2008
Messages
572
Reaction score
44
Odp: Support - pomoc przy pisaniu skrypt?w

Funkcja doPlayerPopupFYI(cid, message) - wyskakujace okienko
Nie uzywaj zmiennych, ktorych nie zadeklarowales.
 

olafo

Active User
Joined
Sep 9, 2009
Messages
79
Reaction score
0
Odp: Support - pomoc przy pisaniu skrypt?w

prosze was o zrobienie skryptu ze gdy patzy sie na summona pisze you see a abra.it belongs to >moj nick
szukalem wszedzie, niemam zielonego pojecia o skryptach a potrzebuje tego :(
zedytowac ten skrypt zeby leczyl wszystkie pokemony:

Code:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
 
function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx)
 
end
 
 
function onCreatureAppear(creature)
 
end
 
 
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function getPokemonMaxLife(name)
                local file = io.open('data/monster/monsters.xml','r')
                local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>')
                file:close()
                local data = io.open('data/monster/'..(arquivo or ''),'r')
                if not data then
                        return 100
                end
                local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
                data:close()
                return maximo
end
 
function onCreatureTurn(creature)
 
end
 
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
 
 
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi')) and getDistanceToCreature(cid) < 4 then
	if getPlayerStorageValue(cid, 25000) == 5 then       
	return selfSay('Você est? montando.')
	end
	if getPlayerStorageValue(cid, 23000) == 5 then
	return selfSay('Você est? voando.')
	end
if #getCreatureSummons(cid) >= 1 then
selfSay('Voce precisa botar seus pokemons dentro da pokebola.')
focus = 0
talk_start = 0
return TRUE
end 

local idballs = {
[2532] = {2531},
[2653] = {2557},
[2654] = {2525},
[2652] = {2524},
[2195] = {2523},
[2531] = {2532},
[2557] = {2653},
[2525] = {2654},
[2524] = {2652},
[2523] = {2195},
}

local balls = idballs[getPlayerSlotItem(cid,8).itemid]
if balls == nil then
return selfSay('Coloque seu pokemon slot da Pokeball para ele ser curado!!')
end


local nome = getItemAttribute(getPlayerSlotItem(cid,8).uid,"name")
local poke_name1 = nome:match('(.-) Pokeball')
local poke_name2 = nome:match('(.-) Superball')
local poke_name3 = nome:match('(.-) Ultraball')
local poke_name4 = nome:match('(.-) Greatball')
local poke_name5 = nome:match('(.-) Masterball')

if poke_name1 == nil and poke_name2 == nil and poke_name3 == nil and poke_name4 == nil and poke_name5 == nil then
return doPlayerSendCancel(cid,"coloque no lugar correto")
end

if poke_name1 ~= nil then
poke_name = poke_name1
elseif poke_name2 ~= nil then 
poke_name = poke_name2
elseif poke_name3 ~= nil then 
poke_name = poke_name3
elseif poke_name4 ~= nil then 
poke_name = poke_name4
elseif poke_name5 ~= nil then 
poke_name = poke_name5
end

doItemSetAttribute(getPlayerSlotItem(cid,8).uid, "aid", getPokemonMaxLife(poke_name))
selfSay("You is better, Let's go Battle!!")
doTransformItem(getPlayerSlotItem(cid, 8).uid, balls[1])
local hp = getCreatureMaxHealth(cid)
doCreatureAddHealth(cid, hp)

focus = 0
talk_start = 0
end
end
 
function onCreatureChangeOutfit(creature)
 
end
i zrobic skrypt na limit pokemonow ze w plecaku moze byc max 6 bardzo prosze o pomoc
 
Last edited:
Status
Not open for further replies.
Top