What's new

Skrypty & Kody Spell i informacja

Czopeq

Advanced User
Joined
Jun 29, 2015
Messages
191
Reaction score
6
Hello, chc? zrobi? tak, ?eby wyst?powa?a informacja, ?e gracz zosta? spowolniony. Np. Gracz dostaje spowolnienie to nad nim jest napis "spowolniony".
Chcia?em to zrobi? w creaturescripts, ale nie wiem jak si? odwo?a? do spowolnienia ze spella :eek:
Kto? co?? :D
 

Azuusiek

Advanced User
Joined
May 11, 2015
Messages
258
Reaction score
36
Odp: Spell i informacja

Daj skrypt na to swoje spowolnienie
 

Czopeq

Advanced User
Joined
Jun 29, 2015
Messages
191
Reaction score
6
Odp: Spell i informacja

[LUA]
local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)

local condition = createConditionObject(CONDITION_PARALYZE)

setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000)

setConditionFormula(condition, -0.5, 0, -0.5, 0)

setCombatCondition(combat, condition)

function onCastSpell(cid, var)
doCombat(cid, combat, var)
return true
end

[/LUA]
 

buchaLL

bez spiny, luźno
Joined
Aug 2, 2011
Messages
1,013
Reaction score
68
Age
27
Odp: Spell i informacja

Mo?esz to zrobi? w ten spos?b, lecz to nie zadzia?a do ko?ca tak jak chcesz(przetestuj):
[lua]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var), doCreatureSay(variantToNumber(var), "Spowolniony", TALKTYPE_ORANGE_1)
end[/lua]

Dlatego radz? zrobi? paralyze w actions:
[lua]local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)

local config = {manacost = 0, removeOnUse = true, exh_time = 2, vocations = {2,6}}

config.removeOnUse = getBooleanFromString(config.removeOnUse)

function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isInArray(config.vocations,getPlayerVocation(cid)) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation cannot use this rune.")
return false
end

if (getPlayerMana(cid) < config.manacost) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough mana points.")
return false
end

if(getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(getCreaturePosition(itemEx.uid)) == TRUE) and (getPlayerGroupId(cid) <= 3) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't paralyze in protection zone.")
return false
end

if(exhaustion.check(cid, 5431) == false) then
doAddCondition(itemEx.uid, condition)
doPlayerAddMana(cid, -config.manacost)
doSendMagicEffect(getThingPosition(itemEx.uid), CONST_ME_HITAREA)
doCreatureSay(itemEx.uid, "Spowolniony", TALKTYPE_ORANGE_1)
exhaustion.set(cid, 5431, config.exh_time)
if(item.type > 1 and config.removeOnUse == true) then
doTransformItem(item.uid, item.itemid, item.type-1)
elseif (item.type == 1 and config.removeOnUse == true) then
doRemoveItem(item.uid)
end
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end

return true
end[/lua]
 

Azuusiek

Advanced User
Joined
May 11, 2015
Messages
258
Reaction score
36
Odp: Spell i informacja

[MENTION=353628]buchaLL[/MENTION]
RUNY W ACTIONS POZDRO BOROWIKU XDDDDDDDDDD
 

buchaLL

bez spiny, luźno
Joined
Aug 2, 2011
Messages
1,013
Reaction score
68
Age
27
Odp: Spell i informacja

Manaruny s? tworzone od bardzo dawna w actions, sk?d to zdziwienie?
Pomys? na paralyze w actions wzi??em od Gesiora( ). W pr?bie tworzenia tekstu na targecie zobaczy?em b??dy dlatego da?em w actions.
Czekam na Twoj? propozycj? borowiku.
 

Frosbite

Active User
Joined
Dec 20, 2014
Messages
99
Reaction score
8
Odp: Spell i informacja

Teraz czekam na blyskotliwa odp pro elo skriptera i moderatora Azuu!
[MENTION=83060]ToP[/MENTION]ic hm innym wyjsciem na Twoj problem jest:
nadaj storage wymagane do uzycia tej runy po czym dodaj te storage do np. startu/startowej skrzynki/ground na ktorej sie tworzy postac czy cokolwiek zwiazane z rozpoczeciem gry. no i w creaturescripts takk jak napisales reszte ;)
 

Azuusiek

Advanced User
Joined
May 11, 2015
Messages
258
Reaction score
36
Odp: Spell i informacja

[MENTION=353628]buchaLL[/MENTION]
Manaruna to manaruna - ani magLevela ani levela nie wymaga.
Mo?e wszystkie runy by napisa? w actions? XD Runesystem jest po to, aby by? u?ywany, je?li item jest zadeklarowany jako runa to kod pokazuje po look'u na run? wymagania itd.
Notka moderatorska:
noob buchaLL


[MENTION=426299]Frosbite[/MENTION]
Wielki skrypter odpisuje! Po co tu jakie? storage? :D

[lua]
--- create condition
local times = 10 -- seconds of paralyze
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, times * 1000)
setConditionFormula(condition, -0.5, 0, -0.5, 0)
setCombatCondition(combat, condition)

function sendParalyzedText(cid, pos)
if getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendAnimatedText(getCreaturePosition(cid), "Paralyzed", TEXTCOLOR_RED)
end
end

function onCastSpell(cid, var)
local target = variantToNumber(var)
for i=1, times do
addEvent(sendParalyzedText, i*1000, target)
end
return doCombat(cid, combat, var)
end
[/lua]

Sprawd?, pisane na szybko bo dopiero wsta?em :)
 
Last edited:

buchaLL

bez spiny, luźno
Joined
Aug 2, 2011
Messages
1,013
Reaction score
68
Age
27
Odp: Spell i informacja

Nie zab?y?niesz tak kolego, wybacz. Daruj sobie te idiotyczne komentarze, naprawd? s? zb?dne i ?wiadcz?ce o Twojej niskiej inteligencji.
S? funkcj? dzi?ki kt?rym mo?esz ustawi? wymagany level, mlevel, nawet Ci je wypisz?: getPlayerLevel(cid), getPlayerMagLevel(cid).
Ale mniejsza z tym. Widz?, ?e robisz te same b??dy co ja i skrypt nie zadzia?a pomy?lnie, dlatego w?a?nie da?em paralyze(nie wszystkie runy, tylko paralyze) do actions.
 

Azuusiek

Advanced User
Joined
May 11, 2015
Messages
258
Reaction score
36
Odp: Spell i informacja

Dzia?a skrypt na 100%.
[video]https://i.gyazo.com/96118e92ae02a2b2f6fc95314f555591.mp4[/video]
 
Last edited:
Top