NPC Problem:
This NPC should be giving a person a "Buff" if they are the right Vocation for the right amount of Cash. It shows no error but simply wont proceed. I tryed for hours and edited, changed etc to find the NPC giving a distance buff to simply not giving anything at all again. It stopped answer when I was supposed to say "Yes" and get the Buff. I tryed to go back to where it actually worked with only Distance Buff, but that didn't work either, therefor, I posted the original script to see if ANYONE may see any error at all that could cause this. Important for my Elfs to get those Buffs aswell as Humans getting others. I will have to split the script into 2 parts as its too big, but its THE SAME SCRIPT IN ONE.
Even found the base script:
http://otland.net/threads/buffer.131246/
Also note that I got my "Human Edition" to work perfectly, something happend during my Elf Edit.
Elathriel.xml
This NPC should be giving a person a "Buff" if they are the right Vocation for the right amount of Cash. It shows no error but simply wont proceed. I tryed for hours and edited, changed etc to find the NPC giving a distance buff to simply not giving anything at all again. It stopped answer when I was supposed to say "Yes" and get the Buff. I tryed to go back to where it actually worked with only Distance Buff, but that didn't work either, therefor, I posted the original script to see if ANYONE may see any error at all that could cause this. Important for my Elfs to get those Buffs aswell as Humans getting others. I will have to split the script into 2 parts as its too big, but its THE SAME SCRIPT IN ONE.
Even found the base script:
http://otland.net/threads/buffer.131246/
Also note that I got my "Human Edition" to work perfectly, something happend during my Elf Edit.
Elathriel.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Elathriel" script="data/npc/scripts/AbDendrielBuffer.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="64" head="69" body="0" legs="69" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="{Nature} is Power!" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="nature" />
<parameter key="keyword_reply1" value="As an Elf, you have the power of nature within you. I can show you how to use it, ask me for {help} any time." />
</parameters>
</npc>[/PHP]
AbDendrielBuffer.lua
[PHP]local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- Buff Config beginning --
-- configs
local config = {
storage = 77700,
value = 1,
}
money = 500
invisibleseconds = 3600
magicshieldseconds = 3600
regeseconds = 3600
speedseconds = 3600
skillsseconds = 3600
skillsupgrade = {}
skillsupgrade['distance'] = 15
skillsupgrade['ml'] = 10
-- end configs
-- Configs of buffs
local conditionMagic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMagic, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionMagic, CONDITION_PARAM_TICKS, skillsseconds * 1000)
setConditionParam(conditionMagic, CONDITION_PARAM_STAT_MAGICLEVEL, skillsupgrade['ml'])
local combatInvisible = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(combatInvisible, CONDITION_PARAM_BUFF, true)
setConditionParam(combatInvisible, CONDITION_PARAM_TICKS, invisibleseconds*1000)
local conditionDistance = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDistance, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionDistance, CONDITION_PARAM_TICKS, skillsseconds*1000)
setConditionParam(conditionDistance, CONDITION_PARAM_SKILL_DISTANCE, skillsupgrade['distance'])
local combatUtamo = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(combatUtamo, CONDITION_PARAM_BUFF, true)
setConditionParam(combatUtamo, CONDITION_PARAM_TICKS, magicshieldseconds*1000)
local conditionRege = createConditionObject(CONDITION_REGENERATION)
setConditionParam(conditionRege, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionRege, CONDITION_PARAM_TICKS, regeseconds*1000)
setConditionParam(conditionRege, CONDITION_PARAM_HEALTHGAIN, 5)
setConditionParam(conditionRege, CONDITION_PARAM_HEALTHTICKS, 2000)
local conditionspeed = createConditionObject(CONDITION_HASTE)
setConditionParam(conditionspeed, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionspeed, CONDITION_PARAM_TICKS, speedseconds*1000)
setConditionFormula(conditionspeed, 1.0, -86, 1.0, -86)