local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 4000)
local pos = {x = 836, y = 940, z = 7, stackpos = 253}
local poss = {x = 839, y = 940, z = 7, stackpos = 253}
function onStepIn(cid, item, pos)
if item.actionid == 30102 then
queststatus = getPlayerStorageValue(cid,6580)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You are not allowed to enter the nightmare knights castle.')
doTeleportThing(cid,{x = 837, y = 942, z = 7})
if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
return TRUE
end
doCreatureSay(getThingfromPos(pos).uid, "Begone!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
doCreatureSay(getThingfromPos(poss).uid, "Begone!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
else
if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
return TRUE
end
doCreatureSay(getThingfromPos(pos).uid, "Welcome!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
doCreatureSay(getThingfromPos(poss).uid, "Welcome!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
end
elseif item.actionid == 30103 then
queststatus = getPlayerStorageValue(cid,6580)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You are not allowed to enter the nightmare knights castle.')
doTeleportThing(cid,{x = 838, y = 942, z = 7})
if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
return TRUE
end
doCreatureSay(getThingfromPos(pos).uid, "Begone!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
doCreatureSay(getThingfromPos(poss).uid, "Begone!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
else
if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
return TRUE
end
doCreatureSay(getThingfromPos(pos).uid, "Welcome!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
doCreatureSay(getThingfromPos(poss).uid, "Welcome!", TALKTYPE_SAY)
doAddCondition(cid, exhaust)
end
end
return 1
end