[GUIDE] Expanding: Book of the Wise menu

User Tag List

Results 1 to 14 of 14
  1. #1
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WoW Nice +Rep

    [GUIDE] Expanding: Book of the Wise
  2. #2
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [GUIDE] Expanding: Book of the Wise

    TUTORIAL: Adding Additions to The Book of the Wise
    -------------------------------------------------------------------------------------------------

    Hello, and Welcome to this Tutorial. We will be Learning how to expand current features of the by me released: 'Book of the Wise'. It is more than highly recommended to review the features of the Book, before reading further in the tutorial.

    ---| #1: ADDING TELEPORTLOCATIONS |-------------------------------------------------------------------------------------------------------------------------------
    [STEP 1] Be sure that 'CUSTOM_TELEPORTLOCATIONS_ENABLED' is set to 'true' at the top of the script.
    [STEP 2] Look in the script (below, around line 362) for the Custom Teleport Location Gossipmenu.
    [STEP 3] We now have to add a menu link. The menu link looks like this:
    Code:
    Item:GossipMenuAdditem(Icon, Linkname, UNIQUE_SCRIPTID, 0)
    Icon: This is the displayicon in front of the menutext. You can choose between the following (known) icons:
    Code:
    0 - Chat 
    1 - Vendor
    2 - Flight
    3 - Trainer
    4 - Gear(Equipment)
    5 - Gear(Equipment)
    6 - Bank
    7 - Chat with Point
    8 - Tabard
    9 - Swords
    10 - Gold Dot
    Linkname: The name of the menu, MUST be between " " tags!
    UNIQUE_SCRIPTID: This must be a unique ID that links to the actual scripts that teleports the player.

    EXAMPLE:
    Code:
    Item:GossipMenuAddItem(2, "Teleport to the Mall", 40, 0)
    Add the menu link with the UniqueID to the Custom Menu.
    You will notice a '-- ADD YOUR CUSTOM TELEPORTLOCATIONS BELOW THIS LINE --' insert it below that.

    [STEP 4] Now it's time for the actual teleporting script. We have the link now, but no locations yet.
    Use the following template and fill in the spots tagged with @ @ (Remove the @'s!) I also made them red for better notice.

    Code:
    if (intid == @UNIQUE_SCRIPTID@) then 
    	local icount = Player:GetItemCount(17031)
    	if icount == 0 and (COST_REAGENT_TELEPORTING == true) then Player:SendAreaTriggerMessage("Missing Reagent: Rune of Teleportation") else if (COST_REAGENT_TELEPORTING == true) then Player:RemoveItem(17031,1) end
    	Player:SendBroadcastMessage("The Book of the Wise has successfully teleported you to @YOUR LOCATION@"..TELEPORT_RCOST_ENTERMESSAGE..".")
    	Player:Teleport(@MAPID@, @X@, @Y@, @Z@)
    	end
    	Player:GossipComplete()
    end
    UNIQUE_SCRIPTID: Has to be the same as you filled in at Step 3!
    YOUR LOCATION: Fill in the name of the destination, same as Step 3.
    To retrieve MAPID, X, Y and Z, go to the location (in-game!) and type .GPS, it will print your MAPID and XYZ for you.

    EXAMPLE:
    Code:
    if (intid == 40) then 
    	local icount = Player:GetItemCount(17031)
    	if icount == 0 and (COST_REAGENT_TELEPORTING == true) then Player:SendAreaTriggerMessage("Missing Reagent: Rune of Teleportation") else if (COST_REAGENT_TELEPORTING == true) then Player:RemoveItem(17031,1) end
    	Player:SendBroadcastMessage("The Book of the Wise has successfully teleported you to the Mall"..TELEPORT_RCOST_ENTERMESSAGE..".")
    	Player:Teleport(571, 5760.481934, 587.499817, 649.567932)
    	end
    	Player:GossipComplete()
    end
    Insert the code anywhere in the script, as long as it is not in any other script. It is recommended to place it under all the other teleport locations which are already in.
    [STEP 5] That's it!
    ---

    ---| #2: ADDING SUMMONABLE NPC'S |------------------------------------------------------------------------------------------------------------------------------
    [STEP 1] We are going to assume you have not yet added any additional Summonable NPC's and that the Main Menu of the summoning looks like this:
    Code:
    if (intid == 2) then
    	if (Player:IsInCombat() == true) and (BOOK_USABLE_IN_COMBAT == false) then
    	Player:SendAreaTriggerMessage(""..ERROR_IN_COMBAT_MESSAGE.."")
    	else 
    	Item:GossipCreateMenu(800, Player, 0)
    	Item:GossipMenuAddItem(2, "Summon: Distributor of Magical Books", 122002, 0)
    	Item:GossipMenuAddItem(2, "Summon: Reagent Vendor", 122003, 0)
    	Item:GossipMenuAddItem(0, "<Return to the Index>", 600, 0)
    	Item:GossipSendMenu(Player)
    	end
    end
    You will notice only two Summon options. The Distributor of the Books, and a Reagent vendor. In this tutorial we are going to add an ammunition vendor to the Summoning Menu!
    [STEP 2] First add another line to the piece of code you see above. Add it below this line:
    Code:
    	Item:GossipMenuAddItem(2, "Summon: Reagent Vendor", 122003, 0)
    We will want it to look like this, so the new line we are going to add looks like this:
    Code:
    	Item:GossipMenuAddItem(2, "Summon: NPC NAME/FUNCTION", UNIQUE-ID, 0)
    NPC NAME/FUNCTION: We will take Ammunition Vendor
    UNIQUE-ID: This is used just like an 'URL' for webpages. It will link to the part of code that actually spawns the NPC to you. For example I can use '234255664' if I would like, as long as it is not in use by any other GossipMenu.

    Assuming we use the above information, the output of the new MenuLink looks like this:
    Code:
    	Item:GossipMenuAddItem(2, "Summon: Ammunition Vendor", 234255664, 0)
    Our final output of the Menu should look like this:
    Code:
    if (intid == 2) then
    	if (Player:IsInCombat() == true) and (BOOK_USABLE_IN_COMBAT == false) then
    	Player:SendAreaTriggerMessage(""..ERROR_IN_COMBAT_MESSAGE.."")
    	else 
    	Item:GossipCreateMenu(800, Player, 0)
    	Item:GossipMenuAddItem(2, "Summon: Distributor of Magical Books", 122002, 0)
    	Item:GossipMenuAddItem(2, "Summon: Reagent Vendor", 122003, 0)
    	Item:GossipMenuAddItem(2, "Summon: Ammunition Vendor", 234255664, 0)
    	Item:GossipMenuAddItem(0, "<Return to the Index>", 600, 0)
    	Item:GossipSendMenu(Player)
    	end
    end
    [STEP 3] Now we have come to the more fun part: The script that summons the NPC to your location, and here we will define the ID of the NPC that's being summoned. For this part we will need the UNIQUE-ID you have chosen in Step 2. Locate the following piece of code in your script:
    Code:
    if (intid == 122003) then -- Summon: Reagent Vendor
    	local icount = Player:GetItemCount(4787)
    	if icount == 0 and (COST_REAGENT_NPCSUMMON == true) then
    		Player:SendAreaTriggerMessage("Missing Reagent: Imbued Soul Shard")	
    	else
    		Player:RemoveItem(4787,1)
    		local x =Player:GetX ()
    		local y =Player:GetY ()
    		local z =Player:GetZ ()
    		local o =Player:GetO ()
    		Player:SpawnCreature (28809, x+3, y, z, o, 35, 25000)
    	end
    		Player:GossipComplete()
    end
    Below the above code we are going to add our own teleporting script. It will look like this:
    Code:
    if (intid == UNIQUE-ID) then
    	local icount = Player:GetItemCount(4787)
    	if icount == 0 and (COST_REAGENT_NPCSUMMON == true) then
    		Player:SendAreaTriggerMessage("Missing Reagent: Imbued Soul Shard")	
    	else
    		Player:RemoveItem(4787,1)
    		local x =Player:GetX ()
    		local y =Player:GetY ()
    		local z =Player:GetZ ()
    		local o =Player:GetO ()
    		Player:SpawnCreature (NPCID, x+3, y, z, o, 35, 25000)
    	end
    		Player:GossipComplete()
    end
    What we need to replace is the UNIQUE-ID and the NPC EntryID. The UNIQUE-ID must be the same as the ID you have chosen in Step 2.

    Still assuming we want to summon an Ammunition Vendor, I should make it look like this (I took NPC 28800 for the AmmoVendor):
    Code:
    if (intid == 234255664) 
    	local icount = Player:GetItemCount(4787)
    	if icount == 0 and (COST_REAGENT_NPCSUMMON == true) then
    		Player:SendAreaTriggerMessage("Missing Reagent: Imbued Soul Shard")	
    	else
    		Player:RemoveItem(4787,1)
    		local x =Player:GetX ()
    		local y =Player:GetY ()
    		local z =Player:GetZ ()
    		local o =Player:GetO ()
    		Player:SpawnCreature (28800, x+3, y, z, o, 35, 25000)
    	end
    		Player:GossipComplete()
    end
    Just insert it where I said to (below script) and you'll be ready to go .
    I will add some more tutorials tomorrow, but I have some things to do right now .

    Claiver
    Last edited by Claiver; 03-21-2009 at 07:48 AM.

  3. #3
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <reserved>

  4. #4
    munkenfunk's Avatar Member
    Reputation
    6
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im getting an Error...
    Scripts/book of the wise.lua:101: attemt to compare nil with number.
    And nothing happens when i click on the book :/

    Any Help would be appriciated (:

  5. #5
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by munkenfunk View Post
    Im getting an Error...
    Scripts/book of the wise.lua:101: attemt to compare nil with number.
    And nothing happens when i click on the book :/

    Any Help would be appriciated (:
    Do you see a blue glow when you use the book? And, please give me your code what you tried (the script around line 101).

    Claiver

  6. #6
    munkenfunk's Avatar Member
    Reputation
    6
    Join Date
    Feb 2007
    Posts
    76
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes there is a blue Glow, but im not sure where line 101 is xD but ill try to find it :b

  7. #7
    mungham1234's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd use this in my server if i knew how. but for now its all a blur...
    The concept is AMAZING!

  8. #8
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very easy. Execute the .SQL on the Book of the Wise mainpost.
    Then place this .LUA file in the ArceEmu/Scripts folder.


    xx.Claiver

  9. #9
    Ethix's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get a SQL error when I try to Execute the script. Can you help me?

    I have ArcEmu.

    Heres the Message.


  10. #10
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ethix View Post
    I get a SQL error when I try to Execute the script. Can you help me?

    I have ArcEmu.

    Heres the Message.

    Hmm it says line 8, but that's
    Code:
    values
    And that's it? Seems quite weird.

    Claiver

  11. #11
    Ethix's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm new at this but on line 9 could the blank '' be the problem? Said that in the error message, but I don't know -.- did anyone else have a problem with the script?

  12. #12
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ethix View Post
    I'm new at this but on line 9 could the blank '' be the problem? Said that in the error message, but I don't know -.- did anyone else have a problem with the script?
    Unless your column doesn't allow NUL, no. It's just an empty string ' ' meaning nothing, should work as intended -.- .

  13. #13
    gimmeurlife's Avatar Member
    Reputation
    12
    Join Date
    Aug 2008
    Posts
    99
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I havent had a chance to try the book of the wise yet but i'm gonna give it a shot +Rep soon as my timer is gone =/

  14. #14
    Rayuski's Avatar Member
    Reputation
    3
    Join Date
    May 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    guide

    great guide!!

Similar Threads

  1. [Release] The Book of the Wise
    By Claiver in forum WoW EMU General Releases
    Replies: 71
    Last Post: 07-06-2009, 06:24 AM
  2. [Guide] How to: Use the WoWModelViewer Greenscreen
    By Cursed in forum Art & Graphic Design
    Replies: 5
    Last Post: 11-15-2007, 03:57 PM
  3. [Request] A Guide How to Change the Sky
    By Wolfly in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 11-05-2007, 02:39 PM
  4. [Guide] How to get the "WoW Card" loots
    By [ Prototype ] in forum World of Warcraft Guides
    Replies: 46
    Last Post: 10-14-2007, 07:16 PM
  5. Video Guides to MOST of the secret places in WoW
    By Matt in forum World of Warcraft Guides
    Replies: 4
    Last Post: 05-19-2006, 10:33 PM
All times are GMT -5. The time now is 08:27 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