Welcome to AC Web.
Results 1 to 10 of 10
  1. #1


    Join Date
    Mar 2014
    Location
    http://strong-wow.com
    Posts
    1,076

    [C++ GossipTutroial] for ac-web [Old Rev]


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hello guys I have made my first C++ for ac-webians, which is a CreatureScript, With custom options, so I hope so you guys like it, and appreciate this release.

    if you suggest, some gossip menus I'll be Glad to update C++ with new suggest's, or review my code to help further benefit my learning.


    Preview of that Script

    http://prntscr.com/l4ucf7


    PHP Code:
    /*Creator Minodev's*/

    #include "ScriptMgr.h"
    #include "Creature.h"
    #include "Player.h"
    #include "SpellHistory.h"
    #include "ScriptedGossip.h"
    #include "WorldSession.h"

    const uint32 buffSpells[10] = { 33077,33078,33079,33080,33081,33082,42995,48161,25898 };

    enum spells
    {
        
    RIDING_SPELL 90266
    };

    class 
    GossipTutroial : public CreatureScript
    {
    public:
        
    GossipTutroial() : CreatureScript("GossipTutroial") { }

        
    bool OnGossipHello(Player playerCreature creature)
        {
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/Spell_Holy_SurgeOfLight:30:30:-22|t Heal me"GOSSIP_SENDER_MAIN1);
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/Spell_Nature_TimeStop:30:30:-22|t Reset My CD"GOSSIP_SENDER_MAIN2);
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/INV_Misc_Bandage_Netherweave:30:30:-22|t Buff Me"GOSSIP_SENDER_MAIN3);
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/Ability_Marksmanship:30:30:-22|t Reset My Talents"GOSSIP_SENDER_MAIN4);
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/Ability_SteelMelee:30:30:-22|t Max my Weapon Skills"GOSSIP_SENDER_MAIN5);
            
    player->ADD_GOSSIP_ITEM(0"|TInterface/ICONS/spell_nature_swiftness:30:30:-22|t Learn Riding"GOSSIP_SENDER_MAIN6);
            
    player->PlayerTalkClass->SendGossipMenu(player->GetGossipTextId(creature), creature->GetGUID());
            return 
    true;

        }
        
    bool OnGossipSelect(PlayerplayerCreaturecreatureuint32 senderuint32 actionoverride
        
    {
            switch (
    action)
            {
            case 
    1:
            {
                
    player->SetFullHealth();
                
    player->GetSession()->SendAreaTriggerMessage("You Healed");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();

            }break;
            case 
    2:
            {
                
    player->GetSpellHistory()->ResetAllCooldowns();
                
    player->GetSession()->SendAreaTriggerMessage("Your Spells Has been Reseted");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();

            }break;
            case 
    3:
            {
                for (const 
    uint32spell buffSpells)
                    
    creature->CastSpell(playerspelltrue);
                
    player->GetSession()->SendAreaTriggerMessage("You Buffed");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();
            }break;
            case 
    4:
            {
                
    player->ResetTalents();
                
    player->GetSession()->SendAreaTriggerMessage("Your Talents Reseted");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();
            }break;
            case 
    5:
            {
                
    player->UpdateSkillsToMaxSkillsForLevel();
                
    player->GetSession()->SendAreaTriggerMessage("You Maxed Weapon Skills");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();
            }break;
            case 
    6:
            {
                
    player->CastSpell(playerRIDING_SPELLtrue);
                
    player->GetSession()->SendAreaTriggerMessage("Riding Spell Learned");
                
    player->PlayerTalkClass->ClearMenus();
                
    player->CLOSE_GOSSIP_MENU();
            }break;
            return 
    true;
            }
        }
    };


    void AddSC_GossipTutroial()
    {
        new 
    GossipTutroial();

    PHP Code:
    https://pastebin.com/xrCHw250 
    Last edited by XxTryXx; Today at 05:32 PM.

  2. #2

  3. #3

  4. #4


    Join Date
    Mar 2014
    Location
    http://strong-wow.com
    Posts
    1,076
    thx boys,

  5. #5
    http://YugoWoW.com/

    Join Date
    Feb 2014
    Location
    http://yugowow.com.Com/
    Posts
    2,193
    Good job nub <3 xD

  6. #6


    Join Date
    Mar 2014
    Location
    http://strong-wow.com
    Posts
    1,076
    Quote Originally Posted by JadaDev View Post
    Good job nub <3 xD
    Thank you nub :3

  7. #7
    weird like that

    Join Date
    Feb 2010
    Location
    http://rochet2.github.io/
    Posts
    5,245
    You should always either send a new gossip menu or close the gossip menu in on gossip select.
    Otherwise, the gossip menu stays open and none of the options work when the player clicks them (gossip menu is stuck / frozen, client probably does not send the opcode anymore).
    This is true for 3.3.5 at least. Not sure about higher patches.

  8. #8


    Join Date
    Mar 2014
    Location
    http://strong-wow.com
    Posts
    1,076
    Quote Originally Posted by Rochet2 View Post
    You should always either send a new gossip menu or close the gossip menu in on gossip select.
    Otherwise, the gossip menu stays open and none of the options work when the player clicks them (gossip menu is stuck / frozen, client probably does not send the opcode anymore).
    This is true for 3.3.5 at least. Not sure about higher patches.
    Well yeah, I'll gonna update soon Thank you Rochet2

  9. #9
    good job, def take the rochet2 suggestion

  10. #10


    Join Date
    Mar 2014
    Location
    http://strong-wow.com
    Posts
    1,076

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    thank you guys about suggest updated,

    - - - Updated - - -

    bump updated,

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •