I n00b, msn me6/14/2009 2:13:42 PM Cavito- fawk this place says:
ok thats easy then, i will check it out soon
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.6, -200, -2.0, -280)
local area = createCombatArea(AREA_CROSS1X1)
setCombatArea(combat, area)
function onCastSpell(cid, var)
if getWeaponType(itemid) == WEAPON_SWORD then
animationShoot = CONST_ANI_WHIRLWINDSWORD
elseif getWeaponType(itemid) == WEAPON_AXE then
animationShoot = CONST_ANI_WHIRLWINDAXE
elseif getWeaponType(itemid) == WEAPON_CLUB then
animationShoot = CONST_ANI_WHIRLWINDCLUB
else
return nil
end
pPos = getPlayerPosition(cid)
doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y-1, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y+1, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y-2, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y-2, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y-2, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y+1, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y-1, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y+2, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y+2, z=pPos.z}, animationShoot)
doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y+2, z=pPos.z}, animationShoot)
return doCombat(cid, combat, var)
end
local config = {
bananaID = 3434, -- change to banana id
message = ""
}
function onKill(cid, target)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message)
doPlayerAddItem(cid, config.bananaID, 1)
end
return TRUE
end
Thank you! <3 Going to try out right away!
How does it work? I just made a .lua file inside action/script and when I kill a player I don't gain any banana
<event type="advance" name="Banana" event="script" value="Banana.lua" />
local config = {
bananaID = 3434, -- change to banana id
message = ""
}
function onKill(cid, target)
if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message)
doPlayerAddItem(cid, config.bananaID, 1)
end
return TRUE
end
registerCreatureEvent(cid, "Banana")
creaturescripts/creaturescripts.xml
PHP:<event type="advance" name="Banana" event="script" value="Banana.lua" />
creaturescripts/scripts/Banana.lua
Lua:local config = { bananaID = 3434, -- change to banana id message = "" } function onKill(cid, target) if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message) doPlayerAddItem(cid, config.bananaID, 1) end return TRUE end
creaturescripts/scripts/login.lua
before return TRUE
add
Lua:registerCreatureEvent(cid, "Banana")
creaturescripts/creaturescripts.xml
PHP:<event type="advance" name="Banana" event="script" value="Banana.lua" />
creaturescripts/scripts/Banana.lua
Lua:local config = { bananaID = 3434, -- change to banana id message = "" } function onKill(cid, target) if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, config.message) doPlayerAddItem(cid, config.bananaID, 1) end return TRUE end
creaturescripts/scripts/login.lua
before return TRUE
add
Lua:registerCreatureEvent(cid, "Banana")
Hello
Type of Script: When you walk on a tile (in this case, stone tile, ID 426) you will get a private msg from a npc (named "Angel" for example), she will ask you if u wanna use her power, because you can only use it once. If you dont want to use it simple type "no/bye, w/e" and if you want to use it type "yes".
the power is that you will gain 1 magic level, and when you walk on the tile again if you have used the power u will get a massage says you cant use it.
(pretty long text, sry ._.)
Priority: medium-high, i need it =)
Reason of Request: Well, i want it in one of my quests on my ot ;p
You could post it in public if u want, dosnt really mather to me and i think some people would use it .
Thanks in advance!
Regards, zkum
I want this script to work with Tfs 0.3.4PL2
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.6, -200, -2.0, -280) local area = createCombatArea(AREA_CROSS1X1) setCombatArea(combat, area) function onCastSpell(cid, var) if getWeaponType(itemid) == WEAPON_SWORD then animationShoot = CONST_ANI_WHIRLWINDSWORD elseif getWeaponType(itemid) == WEAPON_AXE then animationShoot = CONST_ANI_WHIRLWINDAXE elseif getWeaponType(itemid) == WEAPON_CLUB then animationShoot = CONST_ANI_WHIRLWINDCLUB else return nil end pPos = getPlayerPosition(cid) doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y-1, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y+1, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y-2, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y-2, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y-2, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y+1, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y-1, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y+2, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y+2, z=pPos.z}, animationShoot) doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y+2, z=pPos.z}, animationShoot) return doCombat(cid, combat, var) end
EDIT: Ooobs..
Type of Script: Spell
Priority: Not so fast ;p
Reason of Request: Cuz I had it when I had it on my ot before(on like 8.0)
Public/Private: Public ^^
<talkaction words="power" event="script" value="angelpower.lua"/>
function onSay(cid, words, param, channel)
if(getPlayerStorageValue(cid, 63452) == 1) then
setPlayerStorageValue(cid, 63452, 2) --can't do again--
doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, ignoreBuffs))) --recieving power--
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have recieved my power.") --recieving message
return true
else
return false
end
end
<movevent type="StepIn" itemid="426" event="script" value="angelpower.lua"/>
<movevent type="StepOut" itemid="426" event="script" value="angelpower.lua"/>
function onStepIn(cid, item, pos)
if(item.actionid == 5435) then
if(isPlayer(cid) and getPlayerStorageValue(cid, 63452) < 1) then
setPlayerStorageValue(cid, 63452, 1) --tile storage--
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "If you require my power please say \"power\".") --talkaction message--
end
if(isPlayer(cid) and getPlayerStorageValue(cid, 63452) == 2) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Away with you! You have recieved my power already!") --Already completed message--
end
return true
end
end
function onStepOut(cid, item, pos)
if(item.actionid == 5435) then
if(isPlayer(cid) and getPlayerStorageValue(cid, 63452) < 2) then
setPlayerStorageValue(cid, 63452, 0) --left without answering--
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "I see. Come back to harness my power another time!")
end
end
return true
end
Type of Script: action
Priority: Not so fast
Reason of Request: I dont have scripter on my Ot
Description: Adds hp and mana. Based of lvl (knights), mlvl (mages). It shouldnt be strong, but it should protect 40 knight attacked by 90 rp
Public