[Scripting] Problem - Skill Trainer menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Scripting] Problem - Skill Trainer

    Alright. Missing Skill Trainer - teaches the skills obtained through quests; like Warrior's Stances, Druid's Forms, etc. I think I got it down, it would be something like this right?

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Warrior", 1, 0)
    unit:GossipMenuAddItem(2, "Paladin", 2, 0)
    unit:GossipMenuAddItem(2, "Hunter", 3, 0)
    unit:GossipMenuAddItem(2, "Shaman", 4, 0)
    unit:GossipMenuAddItem(2, "Druid", 5, 0)
    unit:GossipMenuAddItem(2, "Rogue", 6, 0)
    unit:GossipMenuAddItem(2, "Mage", 7, 0)
    unit:GossipMenuAddItem(2, "Warlock", 8, 0)
    unit:GossipMenuAddItem(2, "Priest", 9, 0)
    unit:GossipMenuAddItem(2, "Death Knight", 10, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 300) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(2, "Warrior", 1, 0)
    unit:GossipMenuAddItem(2, "Paladin", 2, 0)
    unit:GossipMenuAddItem(2, "Hunter", 3, 0)
    unit:GossipMenuAddItem(2, "Shaman", 4, 0)
    unit:GossipMenuAddItem(2, "Druid", 5, 0)
    unit:GossipMenuAddItem(2, "Rogue", 6, 0)
    unit:GossipMenuAddItem(2, "Mage", 7, 0)
    unit:GossipMenuAddItem(2, "Warlock", 8, 0)
    unit:GossipMenuAddItem(2, "Priest", 9, 0)
    unit:GossipMenuAddItem(2, "Death Knight", 10, 0)
    unit:GossipSendMenu(player)
    
    if(intid == 1) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Defensive Stance", 11, 0)
    unit:GossipMenuAddItem(1, "Berserker Stance", 12, 0)
    unit:GossipMenuAddItem(1, "Intercept", 13, 0)
    unit:GossipMenuAddItem(1, "Taunt", 14, 0)
    unit:GossipMenuAddItem(0, "[Back]", 300, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 2) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Blessing of Salvation", 15, 0)
    unit:GossipMenuAddItem(1, "Sense Undead", 16, 0)
    unit:GossipMenuAddItem(1, "Redemption", 17, 0)
    unit:GossipMenuAddItem(1, "Hammer of Justice", 18, 0)
    unit:GossipMenuAddItem(1, "Parry (Passive)", 19, 0)
    unit:GossipMenuAddItem(0, "[Back]", 300, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 3) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Tame Beast", 20, 0)
    unit:GossipMenuAddItem(1, "Call Pet", 21, 0)
    unit:GossipMenuAddItem(1, "Revive Pet", 22, 0)
    unit:GossipMenuAddItem(1, "Feed Pet", 23, 0)
    unit:GossipMenuAddItem(1, "Dismiss Pet", 24, 0)
    unit:GossipMenuAddItem(0, "[Back]", 300, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 4) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Searing Totem", 25, 0)
    unit:GossipMenuAddItem(1, "Healing Totem", 26, 0)
    unit:GossipMenuAddItem(1, "Stoneskin Totem", 27, 0)
    unit:GossipMenuAddItem(0, "[Back]", 300, 0)
    unit:GossipSendMenu(player)
    end
    
    
    
    I'm not going to go through and do every class, this is just to show a general idea.
    
    
    if(intid == 11) then
    player:LearnSpell(71)
    end
    
    if(intid == 12) then
    player:LearnSpell(2458)
    end
    
    if(intid == 13) then
    player:LearnSpell(30151)
    end
    
    if(intid == 14) then
    player:LearnSpell(355)
    end
    
    
    
    Again, not going to do the whole thing here.
    
    
    end
    
    RegisterUnitGossipEvent(66987, 1, "On_Gossip")
    RegisterUnitGossipEvent(66987, 2, "Gossip_Submenus")

    Okay, if that looks right, I'm getting a problem in game. Like a mage could go up and learn Intercept.

    Is there a way I can make it so when every other class (but a warrior) that clicks on the Warrior tab, says something like, "You cannot learn anything here."

    Like have the NPC recognize the players class.
    Last edited by Zudrik; 12-11-2008 at 07:11 PM.

    [Scripting] Problem - Skill Trainer
  2. #2
    benzkool's Avatar Member
    Reputation
    23
    Join Date
    Nov 2008
    Posts
    119
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey join my hamachi network and we can have live chat im pretty good with lua

    Network name - WoW Help Center
    pass- 123

    Remember that hamachi is cap sensitive hope to see you soon!

  3. #3
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I recall correctly, you can't find classes in Lua, so you would have to do this in C++.

    I live in a shoe

  4. #4
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And Lua gossipmenu syntax really resembles the C++ syntax, so it won't be too hard

  5. #5
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh, I'll try. I've tried to learn C++ before, but I learn by staring at aleady made scripts then editing them.

  6. #6
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which is a great way to learn. Just make sure you're taking properly organized scripts

Similar Threads

  1. LUA Scripting Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-10-2008, 02:00 PM
  2. Lua scripts problem
    By Mr.Ice.Cold in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-02-2008, 11:44 AM
  3. Lua Boss Script Problems!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-22-2008, 08:59 PM
  4. [bug] Skill trainers wont learn out skills
    By cutelyn in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-02-2007, 02:18 PM
  5. How do i make a custom weapons/riding skill trainer?
    By oliver1993 in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 09-30-2007, 08:48 AM
All times are GMT -5. The time now is 04:03 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