What's new

Skrypty & Kody Pomoc w skrypcie na % buffa !

Kage Thunder

Advanced User
Joined
Sep 30, 2012
Messages
184
Reaction score
3
Witam, mam problem ot?? spr?bowa?em zrobi? skrypt, dzia?a tylko ?e jest problem, zamiast dodawac melee % to dodaje skille i to w sporej ilo?ci i nie wiem co jest nie tak, m?g?by kto? pom?c ?eby dodawa?o +15% melee, drugi na tej samej zasadzie +15% magic a trzeci +15% prot all? Bo jak ja pr?buje to wszystko dodaje skille a jest napisane "meleepercent" wiec co? nie halo :D z g?ry dzi?ki.



[LUA]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 55)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 100000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 115)
setCombatCondition(combat, condition)


function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 1000) == 0 then
doCombat(cid, combat, var)
setPlayerStorageValue(cid, 1000, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff On")
else
doRemoveCondition(cid, CONDITION_PARAM_SKILL_MELEEPERCENT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff Off")
setPlayerStorageValue(cid, 1000, 0)
end
end[/LUA]
 

reeeq

Active User
Joined
Mar 3, 2012
Messages
141
Reaction score
10
Odp: Pomoc w skrypcie na % buffa !

Spr?buj uzyc zamiast SKILL_MELEE
[XML]COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE [/XML]
 

Kage Thunder

Advanced User
Joined
Sep 30, 2012
Messages
184
Reaction score
3
Odp: Pomoc w skrypcie na % buffa !

Pr?bowa?em tak ju? i nic nie dzia?a, nawet b??du w konsoli nie pokazuje wi?c dlatego nie wiem co jest nie tak :/
 

reeeq

Active User
Joined
Mar 3, 2012
Messages
141
Reaction score
10
Odp: Pomoc w skrypcie na % buffa !

[LUA]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 55)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 100000)
setConditionParam(condition, CONDITION_PARAM_INCREASEMAGICPERCENT, 115)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)


function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 1000) == 0 then
doCombat(cid, combat, var)
setPlayerStorageValue(cid, 1000, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff On")
else
doRemoveCondition(cid, CONDITION_PARAM_SKILL_MELEEPERCENT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Buff Off")
setPlayerStorageValue(cid, 1000, 0)
end
end [/LUA]

Nie wiem czy bedzie dzialac, jestem na telefonie lecz increasemagicpercent to dodaje od czarow rowniez
 

Kage Thunder

Advanced User
Joined
Sep 30, 2012
Messages
184
Reaction score
3
Odp: Pomoc w skrypcie na % buffa !

No w?asnie tyle to sam wiem, ale to nie dzia?a, dlatego si? zwr?ci?em o pomoc, ale dzieki ze pr?bujesz :p Jakby kto? m?g? to jako? rozkmini?, albo zrobi? cos na wz?r tego buffa kt?ry by dzia?a??
 

reeeq

Active User
Joined
Mar 3, 2012
Messages
141
Reaction score
10
Odp: Pomoc w skrypcie na % buffa !

[LUA]
-- Simple "HP Buff from Item" spell by Guitar Freak.

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 39) -- You can change to any effect you desire.
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000) -- Amount of time the buff lasts in miliseconds, so 20000 = 20 seconds.
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 120) -- Amount of HP % added, 100% = Total HP so if you put 120% it adds 20% to the total HP. Putting like 50% cuts your HP to half, etc.
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
if getPlayerItemCount(cid,2151) >= 15 then -- This line checks if the player has the 15 talons. (2151 is the ItemID of the "talon", but you can change it to whatever you want. The "15" is the amount of talons you need for the buff to work)
doPlayerRemoveItem(cid, 2151, 15) -- If he does, it removes the 15 talons and:
return doCombat(cid, combat, var) -- Adds the buff, sends the magic effect, etc.
else -- Otherwise if he doesnt have 15 talons:
doPlayerSendCancel(cid, "You do not have enough talons, you need 15 talons to execute this spell.") -- It sends him this cancel message,
doSendMagicEffect(getCreaturePos(cid), 2) -- Also shows this magic effect on the player which is a "puff" to tell the spell didnt work.
return LUA_ERROR -- And finally cancels everything so the spell doesnt work, the mana is not spent nor any talons taken, and the player is not buffed.
end
end [/LUA]

Masz tutaj wzor z otlandu. Ja niestety bardziej siedze w wersji 7x i nie znam wszystkich funkcji TFS'a ; p
 

Kage Thunder

Advanced User
Joined
Sep 30, 2012
Messages
184
Reaction score
3
Odp: Pomoc w skrypcie na % buffa !

ja te? zbytnio nie znam za du?o tych funkcji, ale pr?bowa?em niekt?re u?y? zamiast maxhealthpercent i nic oprocz tego nie dzia?a w?a?nie :/
 

reeeq

Active User
Joined
Mar 3, 2012
Messages
141
Reaction score
10
Odp: Pomoc w skrypcie na % buffa !

[LUA]CONDITION_PARAM_OWNER = 1
CONDITION_PARAM_TICKS = 2
CONDITION_PARAM_OUTFIT = 3
CONDITION_PARAM_HEALTHGAIN = 4
CONDITION_PARAM_HEALTHTICKS = 5
CONDITION_PARAM_MANAGAIN = 6
CONDITION_PARAM_MANATICKS = 7
CONDITION_PARAM_DELAYED = 8
CONDITION_PARAM_SPEED = 9
CONDITION_PARAM_LIGHT_LEVEL = 10
CONDITION_PARAM_LIGHT_COLOR = 11
CONDITION_PARAM_SOULGAIN = 12
CONDITION_PARAM_SOULTICKS = 13
CONDITION_PARAM_MINVALUE = 14
CONDITION_PARAM_MAXVALUE = 15
CONDITION_PARAM_STARTVALUE = 16
CONDITION_PARAM_TICKINTERVAL = 17
CONDITION_PARAM_FORCEUPDATE = 18
CONDITION_PARAM_SKILL_MELEE = 19
CONDITION_PARAM_SKILL_FIST = 20
CONDITION_PARAM_SKILL_CLUB = 21
CONDITION_PARAM_SKILL_SWORD = 22
CONDITION_PARAM_SKILL_AXE = 23
CONDITION_PARAM_SKILL_DISTANCE = 24
CONDITION_PARAM_SKILL_SHIELD = 25
CONDITION_PARAM_SKILL_FISHING = 26
CONDITION_PARAM_STAT_MAXHEALTH = 27
CONDITION_PARAM_STAT_MAXMANA = 28
CONDITION_PARAM_STAT_SOUL = 29
CONDITION_PARAM_STAT_MAGICLEVEL = 30
CONDITION_PARAM_STAT_MAXHEALTHPERCENT = 31
CONDITION_PARAM_STAT_MAXMANAPERCENT = 32
CONDITION_PARAM_STAT_SOULPERCENT = 33
CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34
CONDITION_PARAM_SKILL_MELEEPERCENT = 35
CONDITION_PARAM_SKILL_FISTPERCENT = 36
CONDITION_PARAM_SKILL_CLUBPERCENT = 37
CONDITION_PARAM_SKILL_SWORDPERCENT = 38
CONDITION_PARAM_SKILL_AXEPERCENT = 39
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40
CONDITION_PARAM_SKILL_SHIELDPERCENT = 41
CONDITION_PARAM_SKILL_FISHINGPERCENT = 42
CONDITION_PARAM_PERIODICDAMAGE = 43
CONDITION_PARAM_BUFF = 44
CONDITION_PARAM_SUBID = 45[/LUA]

lista dostepnych conditionow, nie bedzie sie w niej znajdowac increase, absrob. Mysle jedynie, ze dodac nowy condition w plikach source silnika rowazy sprawe lub szerzej napisany skrypt lua (?)
 
Last edited:
Top