Results 1 to 6 of 6

Thread: Mangos Player Tools NPC

  
  1. #1
    Contributor
    Reputation
    119
    Join Date
    Jun 2008
    Posts
    809

    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.
    http://www.Darkportal-wow.com

  2. #2
    The True Repacker
    Chrispee's Avatar
    Reputation
    672
    Join Date
    Mar 2007
    Location
    Malta
    Posts
    848
    Does this work with trinty ?





  3. #3
    Member
    Reputation
    1
    Join Date
    Nov 2011
    Posts
    16
    To make it work in trinity ull need to backport it using the function trinity uses, nough said.

  4. #4
    Contributor
    Reputation
    119
    Join Date
    Jun 2008
    Posts
    809
    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.
    http://www.Darkportal-wow.com

  5. #5
    Contributor thebigman's Avatar
    Reputation
    83
    Join Date
    Dec 2008
    Location
    In Your Closet
    Posts
    471
    Blog Entries
    1
    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.
    MSN:greenjay333@yahoo.com Contact me for tips or if you think you can teach c++


  6. #6
    Contributor
    Reputation
    119
    Join Date
    Jun 2008
    Posts
    809
    No thebigman.

    It is - causing it to remove the money. So -10*price means remove 10*the listed price.
    http://www.Darkportal-wow.com

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 11:25 AM. Powered by vBulletin® Version 4.1.12
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154