ArcEmu: Violethold/gossip - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Developing

Interesting in developing with us? Join us on IRC: irc.emulationnetwork.com:6667 #arcemu
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Violethold/gossip Gossip handling Lieutnant Sinclari

#1 User is offline   Tulba 

  • Member
  • Pip
  • Group: Members
  • Posts: 29
  • Joined: 21-November 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 23 August 2014 - 01:57 PM

Hi,

here is my Script for Sinclari.
It handles the menu items (If the Violet Hold has started, Sinclari print out the menu item to join it).

Only the gossip of Sinclari is scripted, not more...

Instance_TheVioletHold.cpp
/*
 * ArcEmu MMORPG Server
 * Copyright (C) 2008-2014 <http://www.ArcEmu.org/>
 * Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "Setup.h"

#define MAP_VIOLET_HOLD 608
#define AREA_VIOLET_HOLD 4415

////////////////////////////////////////////////////////
//THV zone: 0
//Prepared creature entry:
//
//Portals
// #define GO_MAIN_PORTAL = 191723
// #define GO_XEVOZZ_PORTAL = 191556
// #define GO_LAVANTHOR_PORTAL = 191566
// #define GO_ICHORON_PORTAL = 191722
// #define GO_ZURAMAT_THE_OBLITERATOR_PORTAL = 191565
// #define GO_EREKEM_PORTAL = 191564
// #define GO_MORAGG_PORTAL = 191606
//
//Crystals
// #define GO_FIRST_ACTIVATION_CRYSTAL = 193615
// #define GO_ACTIVATION_CRYSTAL = 193611
//
//Spell Crytals
// #define SPELL_ARCANE_LIGHTNING = 57930
//
//Portal Guardians (Normal)
// #define CN_AZURE_INVADER = 30661
// #define CN_AZURE_SPELLBREAKER = 30662
// #define CN_AZURE_BINDER = 30663
// #define CN_AZURE_MAGE_SLAYER = 30664
// #define CN_AZURE_CAPTAIN = 30666
// #define CN_AZURE_SORCEROR = 30667
// #define CN_AZURE_RAIDER = 30668
// #define CN_AZURE_STALKER = 32191
//
//Bosses
// #define CN_EREKEM = 29315
// #define CN_MORAGG = 29316
// #define CN_ICHORON = 29313
// #define CN_XEVOZZ = 29266
// #define CN_LAVANTHOR = 29312
// #define CN_TURAMAT_THE_OBLITERATOR = 29314
// #define CN_CYANIGOSA = 31134
//
//
//ToDos:
// Sinclari -> Gossip and event (Sinclari and Guards goes out)
////////////////////////////////////////////////////////
//Event: Waves
//
//Effects:
//Spawning portals, spawning bosses, adding timer
//
//Devnotes:
//
///////////////////////////////////////////////////////

///////////////////////////////////////////////////////
//TheVioletHold Instance

class TheVioletHoldScript : public MoonInstanceScript
{
	friend class Sinclari; // Friendship forever ;-)

public:
	
	MOONSCRIPT_INSTANCE_FACTORY_FUNCTION(TheVioletHoldScript, MoonInstanceScript);
	TheVioletHoldScript(MapMgr* pMapMgr) : MoonInstanceScript(pMapMgr)
	{
		
	};

	void SetInstanceData(uint32 pType, uint32 pIndex, uint32 pData)
	{
		if(pType != Data_EncounterState || pIndex == 0)
			return;

		EncounterMap::iterator Iter = mEncounters.find(pIndex);
		if(Iter == mEncounters.end())
			return;

		(*Iter).second.mState = (EncounterState)pData;
	};

	uint32 GetInstanceData(uint32 pType, uint32 pIndex)
	{
		if(pType != Data_EncounterState || pIndex == 0)
			return 0;

		EncounterMap::iterator Iter = mEncounters.find(pIndex);
		if(Iter == mEncounters.end())
			return 0;

		return (*Iter).second.mState;
	};

	void OnPlayerEnter(Player* pPlayer)
	{
		TheVioletHoldScript* pInstance = (TheVioletHoldScript*)pPlayer->GetMapMgr()->GetScript();
		if(!pInstance)
			return;

		if(pInstance->GetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD) == State_NotStarted || pInstance->GetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD) == NULL)
		{
			mEncounters.insert(EncounterMap::value_type(MAP_VIOLET_HOLD, State_NotStarted));
		}

	}
};


///////////////////////////////////////////////////////
//Start event: Lieutnant Sinclari Gossip and walk out
/*
SINCLARI
Text 1: If first portalguard dies, sinclari yells: "Prison guards, we are oleaving! These adventurers are taking over! Go go go!"
-- Prison guards leave the violet hold, sinclari stands behind the door and close it
Text 2: sinclari says: "I'm locking the door. Good luck, and thank you for doing this."

PORTAL 1
-- First portal arrives. First Portal Guardian arrives:
YellowWorld: "A Portal Guradian defends the new portal!"
Portal Guardian yells: "The destruction of Dalaran is inevitable!"
-- In Fight
Portal Guardian yells: "You shall not disrupt this portal!"
-- OnDie
Portal Guardian yells: "More portals will take this one's place!"

PORTAL 2
-- Seconf portal arrives.
YellowWorld: "An elite Blue Dragonflight squad appears from the portal!"
-- In Fight
Azure Raider says: "For the Spellweaver!"
-- OnDie
Azure Raider says: "Magic must be... contained..."
...
*/

//Sinclari and Guards
#define CN_LIEUTNANT_SINCLARI 30658
#define CN_VIOLET_HOLD_GUARD1 30659

class Sinclari : public GossipScript
{
	friend class TheVioletHoldScript; // Friendship forever ;-)

public:

	void GossipHello(Object* pObject, Player* pPlayer)
	{
		TheVioletHoldScript* pInstance = (TheVioletHoldScript*)pPlayer->GetMapMgr()->GetScript();
		if(!pInstance)
			return;

		GossipMenu* menu;
		objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), 13853, pPlayer);

		//Page 1: Textid and first menu item
		if(pInstance->GetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD) == State_NotStarted)
		menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Activate the crystals when we get in trouble, right", 1);

		//If VioletHold is startet, Sinclari has this item for people who aould join.
		//Maybe it is not the textid 13853...
		if(pInstance->GetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD) == State_InProgress)
			menu->AddItem(0, "I'm not fighting, so send me in now!", 3);

		menu->SendTo(pPlayer);
	}

	void GossipSelectOption(Object* pObject, Player*  pPlayer, uint32 Id, uint32 IntId, const char* Code)
	{
		TheVioletHoldScript* pInstance = (TheVioletHoldScript*)pPlayer->GetMapMgr()->GetScript();
		if(!pInstance)
			return;

		switch(IntId)
		{
			case 0:
				GossipHello(pObject, pPlayer);
				break;

			case 1:
				{
					  GossipMenu* menu;
					  objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), 13854, pPlayer);
					  menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Get your people to safety, we'll keep the Blue Dragonflight's forces at bay.", 2);
					  menu->SendTo(pPlayer);
					  //EncounterState needs an additional option like State_PreProgress or something similar for this Gossip. "State_InProgress should be set only in case 2.
					  pInstance->SetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD, State_InProgress);

			case 2:
				{
					  // Put it here if an additional EncounterState option has been added to the core
					  //pInstance->SetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD, State_InProgress);
					  Arcemu::Gossip::Menu::Complete(pPlayer);
					  // Now spawn the creature and start attacking
					  // After clicking, start spell and kill enemies. Then move sinclari and the other funny guys outside. Sinclari closing the door and the waves starts
				}break;

			case 3:
				{
					  Arcemu::Gossip::Menu::Complete(pPlayer);

					  pPlayer->SafeTeleport(pPlayer->GetInstanceID(), MAP_VIOLET_HOLD, 1830.531006f, 803.939758f, 44.340508f, 6.281611f);
				}break;
		}
	}

};

///////////////////////////////////////////////////////
//Boss: Erekem
//class ErekemAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Boss: Moragg
//class MoraggAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Boss: Ichoron
//class IchoronAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Boss: Xevozz
//class XevozzAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Boss: Lavanthos
//class LavanthosAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Boss: Zuramat the Obliterator
//class ZuramatTheObliteratorAI : public CreatureAIScript

///////////////////////////////////////////////////////
//Final Boss: Cyanigosa
//class CyanigosaAI : public CreatureAIScript


void SetupTheVioletHold(ScriptMgr* mgr)
{
	//Instance
	mgr->register_instance_script(MAP_VIOLET_HOLD, &TheVioletHoldScript::Create);

	//Gossip
	GossipScript* GSinclari = new Sinclari();
	mgr->register_gossip_script(CN_LIEUTNANT_SINCLARI, GSinclari);

	//Bosses
	//mgr->register_creature_script(CN_EREKEM, &ErekemAI::Create);
	//mgr->register_creature_script(CN_MORAGG, &MoraggAI::Create);
	//mgr->register_creature_script(CN_ICHORON, &IchoronAI::Create);
	//mgr->register_creature_script(CN_XEVOZZ, &XevozzAI::Create);
	//mgr->register_creature_script(CN_LAVANTHOR, &LavanthorAI::Create);
	//mgr->register_creature_script(CN_TURAMAT_THE_OBLITERATOR, &ZuramatTheObliteratorAI::Create);
	//mgr->register_creature_script(CN_CYANIGOSA, &CyanigosaAI::Create);
};

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users