Weird Problem menu

Shout-Out

User Tag List

Results 1 to 12 of 12
  1. #1
    Protyke's Avatar Active Member
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weird Problem

    Okay, on my server I am testing some scripts.. I have a weird problem though. I setup various scripts that I have found on MMOwned that are known to work for ArcEmu.. Now, I compiled these scripts correct and everything and in the ArcEmu - World It loads the script up. However, once I go in-game and spawn the npc it just says.. "Hello.. blah blah" and does not perform the script features. I have tried this on 3 different types of scripts and it does the same thing. I will post screenshots and information that may help you, help me with my problem.


    The first script is supposed to open a window and have you type in a players name -- then you teleport to that player for 500g.. THIS WAS NOT MADE BY ME.

    My first script I'm using:

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    //The cost of the port
    #define FRIENDCOST 5000000
    
    class SCRIPT_DECL FriendPorter : public GossipScript
    {
    public:
    	void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
    	void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
    	void GossipEnd(Object * pObject, Player* Plr);
    	void Destroy()
    	{
    		delete this;
    	}
    };
    
    void FriendPorter::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    	if(Plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < FRIENDCOST)
    	{
    		Plr->BroadcastMessage("You don't have enough gold to teleport to another player.");
    		return;
    	}
    	GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
    	Menu->AddItem(1, "Teleport to Friend (500 Gold)", 1, 1);
    	
        if(AutoSend)
            Menu->SendTo(Plr);
    }
    
    void FriendPorter::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
        switch(IntId)
        {
    		case 0:
    		{
    			GossipHello(pObject, Plr, true);
    		}break;
    		case 1:
    		{
    			if(!Code)
    				return;
    
    			Player * pTarget = objmgr.GetPlayer(Code, false);
    			if(!pTarget)
    			{
    				Plr->BroadcastMessage("Player does not exist.");
    				Plr->Gossip_Complete();
    				return;
    			}
    			if(pTarget->GetTeam() != Plr->GetTeam())
    			{
    				Plr->BroadcastMessage("Player is from the opposing faction.");
    				Plr->Gossip_Complete();
    				return;
    			}
    			uint32 pMap = pTarget->GetMapId();
    			if(pMap != 0 && pMap != 1 && pMap != 530)
    			{
    				Plr->BroadcastMessage("Cannot port to a player inside an instance");
    				Plr->Gossip_Complete();
    				return;
    			}
    			Plr->SetUInt32Value(PLAYER_FIELD_COINAGE, Plr->GetUInt32Value(PLAYER_FIELD_COINAGE)-FRIENDCOST);
    			float pX = pTarget->GetPositionX();
    			float pY = pTarget->GetPositionY();
    			float pZ = pTarget->GetPositionZ();
    			float pO = pTarget->GetOrientation();
    			Plr->Gossip_Complete();
    			Plr->EventTeleport(pMap, pX, pY, pZ);
    			Plr->SetOrientation(pO);
    		}break;
        }
    };
    
    void FriendPorter::GossipEnd(Object * pObject, Player* Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupFriendPorter(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new FriendPorter();
    	mgr->register_item_gossip_script(60012, gs);
    }
    I believe everything is working fine script wise.. Maybe it's a NPC problem?

    Entry ID: 60012
    Flags1: 1
    Type: 7
    Family: 0
    Faction: 35

    Here's what it looks like when I talk to him:



    I have also noticed that when I move my mouse of the NPC I spawned the mouse disappears.

    I also have 3 other scripts (Gambling Script and some other) that do the same exact thing. I really think my NPC Flags or something is messed up.

    What exactly does Flags1 do? Is there a list of Flags1 that I should know about? Also, is there a list of Family IDs and Type IDs?
    Last edited by Protyke; 04-23-2009 at 09:40 PM.
    Yep.

    Weird Problem
  2. #2
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now im assuming that everything else is correct and going to tell u what is making this npc so it will never work...

    this is down thew very bottom
    Code:
    mgr->register_item_gossip_script(60012, gs);
    this says the code is for an item... so your core is looking in the wrong table to start with

    try this
    Code:
    mgr->register_unit_gossip_script(60012, gs);
    As for your other questions..

    My mouse dissapears to so im going to put 1 and 1 together and say its a bug.
    And as for the three other scripts i would suggest posting them if u need any help.
    Last edited by Scubast3ve; 04-23-2009 at 10:02 PM.

  3. #3
    Protyke's Avatar Active Member
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, thanks I'll try this and keep you updated.. I really need some sleep though. :P
    Yep.

  4. #4
    catl2wow's Avatar Member
    Reputation
    4
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The info_str column on the creature_names table should be blank or null for the npc or the pointer disappears. And you need to set the flags column in teh creature_proto table to 1 and Flags1 in the creature_names table to 0. (not sure what this column is for)

  5. #5
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by catl2wow View Post
    The info_str column on the creature_names table should be blank or null for the npc or the pointer disappears. And you need to set the flags column in teh creature_proto table to 1 and Flags1 in the creature_names table to 0. (not sure what this column is for)
    ILY ^^ so that is how i get rid of that pointer thing +Rep for you <3

  6. #6
    catl2wow's Avatar Member
    Reputation
    4
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks =) ILY2 ^.^

  7. #7
    Protyke's Avatar Active Member
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Scubast3ve View Post
    Now im assuming that everything else is correct and going to tell u what is making this npc so it will never work...

    this is down thew very bottom
    Code:
    mgr->register_item_gossip_script(60012, gs);
    this says the code is for an item... so your core is looking in the wrong table to start with

    try this
    Code:
    mgr->register_unit_gossip_script(60012, gs);
    As for your other questions..

    My mouse dissapears to so im going to put 1 and 1 together and say its a bug.
    And as for the three other scripts i would suggest posting them if u need any help.
    Okay, well I just tried that and got an error while compiling (Im not good with C++ so maybe you can help me fix this)

    Code:
    FriendPorter.cpp
    ..\src\FriendPorter\FriendPorter.cpp(87) : error C2039: 'register_unit_gossip_script' : is not a member of 'ScriptMgr'
            d:\documents and settings\mike\desktop\pow\src\arcemu-world\ScriptMgr.h(139) : see declaration of 'ScriptMgr'
    Build log was saved at "file://d:\Documents and Settings\Mike\Desktop\POW\src\scripts\projects\2008_int_release_FriendPorter\BuildLog.htm"
    FriendPorter - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Another C++ script I'm having trouble with is a script to enable a "pvp announce" type thing.. Where when somebody kills another player it says "Bob has killed Frank" .. Bob and Frank are just examples :P .. I found this script off MMOwned.. It is NOT mine so I do not take credit for it.

    Heres the coding for it:
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4018)
    #endif
    
    
    void PvPKill(Player * Plr, Player * Vic)
    {
    // the follow is to check players before death
        if (Plr->GetTeam() == Vic->GetTeam()) return; // Same Team
        if (Plr->GetLowGUID() == Vic->GetLowGUID()) return; // Suicide
    // On pvp kill do following
        char messagePlayerKill[200];
        sprintf(messagePlayerKill, "[|cff00ff00World PvP|r]|cffffffff%s|r has defeated |cffffff00%s|r in pvp combat", Plr->GetName(), Vic->GetName()); 
            sWorld.SendWorldText(messagePlayerKill);
    }
    void SetupPVPKill(ScriptMgr * mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)PvPKill);
    
    }
    The error I get is:

    Code:
    ------ Build started: Project: PvPKill, Configuration: Release Win32 ------
    Compiling...
    PvPKill.cpp
    Linking...
       Creating library ..\..\..\bin\release\script_bin/PvPKill.lib and object ..\..\..\bin\release\script_bin/PvPKill.exp
    Setup.obj : error LNK2001: unresolved external symbol "void __cdecl SetupPvPKill(class ScriptMgr *)" (?SetupPvPKill@@YAXPAVScriptMgr@@@Z)
    ../../../bin/release/script_bin/PvPKill.dll : fatal error LNK1120: 1 unresolved externals
    Build log was saved at "file://d:\Documents and Settings\Mike\Desktop\POW\src\scripts\projects\2008_int_release_PvPKill\BuildLog.htm"
    PvPKill - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Yep.

  8. #8
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for the first one try

    Code:
    mgr->register_creature_gossip_script(60012, gs);
    soz a bit slow 2day

    and as for the second ill look into it
    Last edited by Scubast3ve; 04-24-2009 at 09:03 PM.
    Don't Forget To Give Rep To People Who Help You.

  9. #9
    Protyke's Avatar Active Member
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, Ill try it..

    But in a previous post didn't you already tell me to try

    "mgr->register_unit_gossip_script(60012, gs);"

    Or is this one slightly different? I'll try it anyways :P thanks for your help by the way.

    EDIT:

    I still got another error while compiling the first one..

    Error:
    Code:
    ------ Build started: Project: FriendPorter, Configuration: Release Win32 ------
    Compiling...
    FriendPorter.cpp
    ..\src\FriendPorter\FriendPorter.cpp(87) : error C2039: 'register_unit_gossip_script' : is not a member of 'ScriptMgr'
            d:\documents and settings\mike\desktop\pow\src\arcemu-world\ScriptMgr.h(139) : see declaration of 'ScriptMgr'
    Build log was saved at "file://d:\Documents and Settings\Mike\Desktop\POW\src\scripts\projects\2008_int_release_FriendPorter\BuildLog.htm"
    FriendPorter - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Do you have a messenger I could add you on? Would help ^.^; I could PM you my details (MSN, Yahoo, AIM, Xfire) or you could PM me urs.

    Edit2: I think I know why I'm having that error.. Im supposed to edit something in my Scripts folder inside the main core folder aren't I?


    +REP for helping me.
    Last edited by Protyke; 04-24-2009 at 05:45 PM.
    Yep.

  10. #10
    catl2wow's Avatar Member
    Reputation
    4
    Join Date
    Nov 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the first one change the registering line to
    Code:
    mgr->register_gossip_script(60012, gs);
    This is the exisitng function name as of the default Lua backend for ArcEmu r2537


    As for the second there is something wrong with your compiling environment, i think. It compiled fine for me.

  11. #11
    Protyke's Avatar Active Member
    Reputation
    22
    Join Date
    Apr 2009
    Posts
    22
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, okay. I'll try this.

    Do you have a messenger of some sort that I could add you on? You and Scubast3ve I would like to add if possible

    +REP 4u.

    EDIT: finally got the friend script working Thanks! I just hope I don't have another npc problem where all they say is "Hello.. blah blah"
    Last edited by Protyke; 04-24-2009 at 05:51 PM.
    Yep.

  12. #12
    jackthripper's Avatar Member
    Reputation
    10
    Join Date
    Mar 2009
    Posts
    195
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya c++ is a tricky thing to work with. I wish i had the time to put into learning it myself.
    I HAVE THE BALLS TO ASK STUPID QUESTIONS

Similar Threads

  1. Visual Basic 2010 - Simple but weird problem!
    By Dr0x in forum Programming
    Replies: 3
    Last Post: 03-26-2011, 12:21 AM
  2. [ArcEmu Help] LUA Weird Problem
    By KaMakaZe in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 10-04-2008, 02:17 PM
  3. [Help]Weird Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-25-2008, 11:13 AM
  4. weird connection problem
    By LJN in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-02-2007, 10:37 PM
  5. Weird falling Problem
    By vernath in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 10-22-2007, 11:00 AM
All times are GMT -5. The time now is 12:01 AM. 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