Instance healer NPC menu

User Tag List

Results 1 to 1 of 1
  1. #1
    jinktreek's Avatar Member
    Reputation
    8
    Join Date
    Sep 2008
    Posts
    109
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Instance healer NPC

    Well, I thought I'd try to create an NPC that would follow a player around in an instance and heal them (for lack of players on a server). However, of course, I am confronting a couple of problems. Here is my script so far.

    Code:
    warrior = 1
    pally = 2
    druid = 11
    
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(12674, player, 0)
    unit:GossipMenuAddItem(2, "Who Are You?", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 2) then
    unit:GossipCreateMenu(12674, player, 0)
    unit:GossipMenuAddItem(2, "Who Are You?", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    unit:GossipCreateMenu(12675, player, 0)
    unit:GossipMenuAddItem(2, "Yes, please help me", 8, 0)
    unit:GossipMenuAddItem(2, "No thanks we're set", 9, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 9) then
    unit:GossipCreateMenu(12676, player, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 8) then
    unit:GossipCreateMenu(12671, player, 0)
    unit:GossipSendMenu(player)
    unit:MoveTo(-229.042, 2111.88, 76.8898, 5.08992)
    unit:SendChatMessage(12, 0, "The first group of enemies lie ahead. ATTACK!")
    unit:GossipComplete(player)
    end
    end
    
    function Select_Target(unit, Event)
    unit:GetClosestPlayer()
    	if unit:GetPlayerRace() == warrior then
    	unit:SetUnitToFollow(target)
    	end
    	if unit:GetPlayerRace() == druid then
    	unit:SetUnitToFollow(target)
    	end
    	if unit:GetPlayerRace() == pally then
    	unit:SetUnitToFollow(target)
    	end
    end
    
    
    RegisterUnitGossipEvent(1000015, 1, "On_Gossip")
    RegisterUnitGossipEvent(1000015, 2, "Gossip_Submenus")
    RegisterUnitEvent(1000015, 18, "Select_Target")
    When I enter the instance and wait about a minute, I find that absolutely nothing happens. I have tried to remove:
    Code:
    if unit:GetPlayerRace() == warrior then
    if unit:GetPlayerRace() == pally then
    unit:SetUnitToFollow(target)
    if unit:GetPlayerRace() == druid then
    unit:SetUnitToFollow(target)
    so the script now became:

    Code:
    warrior = 1
    pally = 2
    druid = 11
    
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(12674, player, 0)
    unit:GossipMenuAddItem(2, "Who Are You?", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 2) then
    unit:GossipCreateMenu(12674, player, 0)
    unit:GossipMenuAddItem(2, "Who Are You?", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    unit:GossipCreateMenu(12675, player, 0)
    unit:GossipMenuAddItem(2, "Yes, please help me", 8, 0)
    unit:GossipMenuAddItem(2, "No thanks we're set", 9, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 9) then
    unit:GossipCreateMenu(12676, player, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 8) then
    unit:GossipCreateMenu(12671, player, 0)
    unit:GossipSendMenu(player)
    unit:MoveTo(-229.042, 2111.88, 76.8898, 5.08992)
    unit:SendChatMessage(12, 0, "The first group of enemies lie ahead. ATTACK!")
    unit:GossipComplete(player)
    end
    end
    
    function Select_Target(unit, Event)
    unit:GetClosestPlayer()
    unit:SetUnitToFollow(target)
    end
    
    RegisterUnitGossipEvent(1000015, 1, "On_Gossip")
    RegisterUnitGossipEvent(1000015, 2, "Gossip_Submenus")
    RegisterUnitEvent(1000015, 18, "Select_Target")


    but then I get an error message that the unit that the target the Healer NPC is supposed to follow is "nil" (doesnt exist). I have also tried this, just as a test:

    Code:
    function Select_Target(unit, Event)
    unit:GetClosestPlayer()
    unit:RegisterEvent("Cast_Fireball", 10000, 1)
    end
    
    function Cast_Fireball(unit, Event)
    unit:FullCastSpellOnTarget(133, target)
    end
    However, I (again) get a message that no target is found. Has anybody else been having problems with NPCs selecting characters using LUA? or is there something wrong with the script.
    Thanks!
    Last edited by jinktreek; 01-28-2009 at 06:00 PM.

    Instance healer NPC

Similar Threads

  1. Healer NPC
    By evilchinesefood in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 01-10-2009, 04:14 PM
  2. [Release] Healer, Morpher + Buffer NPC [LUA]
    By Syrup in forum WoW EMU General Releases
    Replies: 3
    Last Post: 09-07-2008, 04:57 PM
  3. [GUIDE] How to make a Healer NPC!
    By kikpp in forum WoW EMU Guides & Tutorials
    Replies: 7
    Last Post: 06-10-2008, 10:45 AM
  4. I Need some help will spawning a NPC Spirit Healer...
    By PRIMO12 in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 12-06-2007, 07:33 PM
  5. I Need some help will spawning a NPC Spirit Healer...
    By PRIMO12 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-05-2007, 05:08 PM
All times are GMT -5. The time now is 11:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search