• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Bug with queen eloise, i dont know why!!

d4rkbl0od

Member
Joined
Mar 21, 2008
Messages
160
Reaction score
7
Someone can help me???
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local talkState = {}
local Topic = {}
local voc = getPlayerVocation(cid)

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

function doNPCTalkALot(msgs,interval)
  local e={}
  local ret={}
  if interval==nil then interval=3000 end --3 seconds is default time between messages
  for aux=1,table.getn(msgs) do
      e[aux]={}
      doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux])
      table.insert(ret,e[aux])
  end
  return(ret)
end


function creatureSayCallback(cid, type, msg)
	if (msgcontains(msg, 'hail') or msgcontains(msg, 'hello') or msgcontains(msg, 'salutations')) and msgcontains(msg, 'queen') and (not npcHandler:isFocused(cid)) then
		npcHandler:say('I greet thee, my loyal subject.', cid, TRUE)
		npcHandler:addFocus(cid)
		Topic[cid] = 0
		
	
		end
		
		
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    local namee = getPlayerName(cid)
    
          	if(msgcontains(msg, 'promotion') or msgcontains(msg, 'Promotion')) then
          	    if doPlayerRemoveMoney(cid, 20000) == FALSE then
          	  selfSay('You don\'t have enough gold coins.',cid)
          	  elseif getPlayerVocation(cid) > 4 then
               selfSay('You are already promoted.',cid)
               elseif getPlayerLevel(cid) <= 19 then 
               selfSay('You need at least level 20 to get promoted.',cid) 
               elseif isPremium(cid) == FALSE then
                 	 selfSay('You need premium account to get promoted.',cid)
                 	 else 
            		selfSay('Do you want to be promoted for 20000 gols coins?',cid)
            		Topic[cid] = 2
  	        end
          
          
          elseif(msgcontains(msg, 'yes') or msgcontains(msg, 'Yes') and Topic[cid] == 2) then
          selfSay('Now you are promoted!',cid)

       end
 

    return TRUE    
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)


when a lvl < 20 says promotion, the npc answer : Do you want to be promoted for 20000 gols coins? ignoring the player level! Whats wrong??
thanks
;*
 
Lol,
LUA:
elseif getPlayerLevel(cid) <= 19 then
Change to
LUA:
elseif getPlayerLevel(cid) <= 20 then
 
Back
Top