Mangos Player Tools NPC menu

User Tag List

Results 1 to 8 of 8
  1. #1
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mangos Player Tools NPC

    Hey there. Been some time since I released something. So i figured I would release this player tools NPC I scripted for my server. Basically What it does it allows you to make an NPC that your players can talk to reset their faction race rename or re-customize their characters...For a price. You can set the price in the configs just remember to edit this part
    Code:
    player->ModifyMoney(-20*price);
    //You would be looking to EDIT the 20 here it will then be 20 times the amount of price which is defined at the top of the script here

    Code:
        price = 500000;
    So pretty much how this works is someone selects a option. it verifies what they want done. Removes the appropriate amount of gold from their inventory and flags their character for that Atlogin Value. The creature then says Relog to "X"
    X being whatever they paid for.

    Well. here is the script. If there seems to be interest in these types of script I do have a few more I could release after working on a few parts of them for public release.

    Code:
    /* Scripted by Kreegoth*/
    
    #include "precompiled.h"
    long long int cash;
    int price;
    
    bool GossipHello_mob_ResetNPC(Player* player, Creature* _Creature)
    {
    		player->ADD_GOSSIP_ITEM( 5, "What can you help me with?" , GOSSIP_SENDER_MAIN, 8888);
            player->ADD_GOSSIP_ITEM( 5, "Can I reset my characters name?" , GOSSIP_SENDER_MAIN, 6666);
    		player->ADD_GOSSIP_ITEM( 5, "Can I change my Faction?" , GOSSIP_SENDER_MAIN, 7777);
    		player->ADD_GOSSIP_ITEM( 5, "Can I change my Race?" , GOSSIP_SENDER_MAIN, 1212);
            player->ADD_GOSSIP_ITEM( 5, "Can I re-customize my character?" , GOSSIP_SENDER_MAIN, 9999);
    		player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
        return true;
    }
    
    void SendDefaultMenu_mob_ResetNPC(Player* player, Creature* _Creature, uint32 action)
    {
        if (player->IsFlying() || player->isDead() || player->isInCombat())
        {
            player->CLOSE_GOSSIP_MENU();
            _Creature->MonsterSay("You are in combat!", LANG_UNIVERSAL);
            return;
        }
    
        if (player->getLevel() < 10)
        {
             player->CLOSE_GOSSIP_MENU();
            _Creature->MonsterSay("You must be lvl 10+", LANG_UNIVERSAL);
            return;
        }
    
        cash = player-> GetMoney();
        price = 500000;
    
        if (cash < price)
        {
            player->CLOSE_GOSSIP_MENU();
            _Creature->MonsterSay("You haven't enough money", LANG_UNIVERSAL);
            return;
        }
    
        switch(action)
        {		
            case 8888: // What Can you help me With?
            {
    		player->CLOSE_GOSSIP_MENU();
    		_Creature->MonsterSay("I can assist you with changing your Characters Name, or With re-customizing your character. For a Fee of course...", LANG_UNIVERSAL);
            }
            break;
    		
    		case 1212: // RACE
            {
                player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Change my Race. <500 Gold>. 500 Gold" , GOSSIP_SENDER_MAIN, 4442);
                player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
            }
            break;
    
            case 7777: // FACTION
            {
                player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Change my Faction. I Understand that this will reset my reputations.<1000 Gold>. 1000 Gold" , GOSSIP_SENDER_MAIN, 4012);
                player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
            }
            break;
    
            case 9999: // RACE
            {
                player->ADD_GOSSIP_ITEM( 5, "Yes I would like to Re-Customize my character <100 Gold>. 100 Gold" , GOSSIP_SENDER_MAIN, 4020);
                player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
            }
            break;		
    		
    		case 6666: // Character
            {
                player->ADD_GOSSIP_ITEM( 5, "Yes I would like to rename my character <50 Gold>. 50 Gold" , GOSSIP_SENDER_MAIN, 4024);
                player->ADD_GOSSIP_ITEM( 5, "Nevermind" , GOSSIP_SENDER_MAIN, 2222);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,_Creature->GetObjectGuid());
            }
            break;		
    		
    case 4012: // Faction Change
    {
    		player->CLOSE_GOSSIP_MENU();
    		player->ModifyMoney(-20*price);
            player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
    		_Creature->MonsterSay("Relog to Change your faction", LANG_UNIVERSAL);
    }
    break;
    
    case 4442: // Recustomize Race
    {
    		player->CLOSE_GOSSIP_MENU();
    		player->ModifyMoney(-10*price);
            player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
    		_Creature->MonsterSay("Relog to Change your race", LANG_UNIVERSAL);
    }
    break;
    
    case 4020: // Recustomize Reset
    {
    		player->CLOSE_GOSSIP_MENU();
    		player->ModifyMoney(-2*price);
            player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
    		_Creature->MonsterSay("Relog to re-customize your character", LANG_UNIVERSAL);
    }
    break;
    
        case 4024: // Rename
        {
    		player->CLOSE_GOSSIP_MENU();
    		player->ModifyMoney(-1*price);
            player->SetAtLoginFlag(AT_LOGIN_RENAME);
    		_Creature->MonsterSay("Relog to rename your character", LANG_UNIVERSAL);
    }
    break;
    
            case 2222: // Nevermind
            {
    			_Creature->MonsterSay("Another time perhaps...", LANG_UNIVERSAL);
                player->CLOSE_GOSSIP_MENU();
            }
    		break;
    		}
    		}
    
    bool GossipSelect_mob_ResetNPC(Player* player, Creature* _Creature, uint32 sender, uint32 action)
    {
        // Main menu
        if (sender == GOSSIP_SENDER_MAIN)
        {
            player->PlayerTalkClass->ClearMenus();
            SendDefaultMenu_mob_ResetNPC(player, _Creature, action);
        }
        return true;
    }
    
    void AddSC_mob_ResetNPC()
    {
        Script* pNewScript;
    
        pNewScript = new Script;
        pNewScript->Name = "mob_ResetNPC";
        pNewScript->pGossipHello = &GossipHello_mob_ResetNPC;
        pNewScript->pGossipSelect = &GossipSelect_mob_ResetNPC;
        pNewScript->RegisterSelf();
    }
    Last edited by kreegoth; 01-10-2012 at 01:22 PM.

    Mangos Player Tools NPC
  2. #2
    Chrispee's Avatar The True Repacker


    Reputation
    686
    Join Date
    Mar 2007
    Posts
    931
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does this work with trinty ?




  3. #3
    brulex's Avatar Corporal
    Reputation
    1
    Join Date
    Nov 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To make it work in trinity ull need to backport it using the function trinity uses, nough said.

  4. #4
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This seems to be the correct sections from Trinity since they seem to be the same if it compiles under their scripts it should work.

    Code:
    found in player.cpp from Trinity download.
    
    AT_LOGIN_CUSTOMIZE
    AT_LOGIN_CHANGE_FACTION
    AT_LOGIN_CHANGE_RACE
    AT_LOGIN_RENAME
    
    found in level2.cpp from Trinity download
    target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
    Since they are the same. As long as it compiles it SHOULD work.
    Last edited by kreegoth; 01-11-2012 at 04:24 PM.

  5. #5
    thebigman's Avatar Contributor Reliable Trader
    CoreCoins Purchaser
    Reputation
    89
    Join Date
    Dec 2008
    Posts
    605
    Thanks G/R
    2/0
    Trade Feedback
    26 (96%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for the pricing couldn't you just do

    player->ModifyMoney(cash-price);

    to handle the pricing and such?

    player->ModifyMoney(-10*price);

    Wouldnt this set the players gold at negatives? multiplying a negative number with a positive one?
    Last edited by thebigman; 01-13-2012 at 06:45 AM.

  6. #6
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No thebigman.

    It is - causing it to remove the money. So -10*price means remove 10*the listed price.

  7. #7
    cainstuhh's Avatar Private
    Reputation
    1
    Join Date
    Jul 2010
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  8. #8
    LilleCarl's Avatar Active Member
    Reputation
    65
    Join Date
    Feb 2008
    Posts
    132
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Chrispee View Post
    Does this work with trinty ?
    Why did i start crying when i read this?

    Maby because it is a MaNGOS Script
    Last edited by LilleCarl; 06-24-2012 at 04:45 PM.
    Violence doesn't solve shit, but everything else.

Similar Threads

  1. Mangos Control every NPC / Totally bug out other players
    By iLLsen in forum WoW EMU Exploits & Bugs
    Replies: 9
    Last Post: 09-17-2009, 12:27 PM
  2. [Release] Mangos WOTLK Tele NPC (NO CORE EDITS!)
    By Shao111 in forum WoW EMU General Releases
    Replies: 33
    Last Post: 06-15-2009, 11:50 AM
  3. [MANGOS] getting an npc to use AoE spells on friendly players
    By resinate in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 05-11-2009, 07:27 PM
  4. MaNGOS Backup Tool
    By welshy123 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 08-15-2008, 12:18 PM
  5. Arcemu website - Arcemu Player tools
    By yrref in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 08-10-2008, 07:19 AM
All times are GMT -5. The time now is 09:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search