ArcEmu: [c++] Custom Boss/quest Script - 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

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

[c++] Custom Boss/quest Script Need some help

#1 User is offline   Elliott Quick 

  • Member
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 17-May 09
  • Gender:Male
  • Location:Grand Rapids, MI
  • Server OS:Windows

Posted 03 November 2010 - 10:41 PM

So i followed the tut that Halestorm wrote. and for somereason I cant get it to compile, its giving me issues with base.h

Heres my script

#include "StdAfx.h"  //This uses the existing functions in Arc's Core
#include "Setup.h"  //So does this
#include "..\Common\base.h"  // This is used to include the ArcAI engine commands

#ifdef WIN32 //This is our structure
#pragma warning(disable:4305)  //This disables an annoying error that may pop up while compiling
#endif

//Marcus The Damned
#define MARCUS   100008  //This is the entry number of the good captain

//Everything below this is his ability ID numbers.
#define MARCUS_VOID_ZONES        30533  
#define MARCUS_SHADOW_BOLT       30505   
#define MARCUS_BURNING_SHADOWS   40739
#define MARCUS_SHADOW_PRISON     40647
#define MARCUS_SHADOW_NOVA       44984
#define MARCUS_DISPERSE          47585

//Aditional NPC's
#define KING_WYRNN              100007               

class MarcusBossAI : public ArcScriptBossAI
{
public:
    ARCSCRIPT_FACTORY_FUNCTION(MarcusBossAI, ArcScriptBossAI);
        MarcusBossAI(Creature* pCreature) : ArcScriptBoss(pCreature)
        {
                marcusVoidZones = AddSpell(MARCUS_VOID_ZONES, Target_RandomPlayer, 33, 4, 20);
                marcusShadowBolt = AddSpell(MARCUS_SHADOW_BOLT, Target_Destination, 9, 3, 12);
                marcusBurningShadows = AddSpell(MARCUS_BURNING_SHADOWS, Target_Current, 15, 0, 8);

                AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_PRISON, Target_Current, 100, 0, 40));
				AddPhaseSpell(2, AddSpell(MARCUS_SHADOW_NOVA, Target_Current, 100, 30, 40));
				AddPhaseSpell(2, AddSpell(MARCUS_DISPERSE, Target_Self, 100, 30, 40));

                AddEmote(Event_OnCombatStart, "Justice... Will... Be Served!", Text_Yell);
                AddEmote(Event_OnTargetDied, "See How The Light... Makes You Weak!", Text_Yell);
        }
		void OnCombatStart(Unit *pTarget)
		{
      // Phase 1
      if (marcusVoidZones != NULL)
      {
         marcusVoidZones->mChance = 33.0f;
         marcusVoidZones->mEnabled = true;
      }
      if (marcusShadowBolt != NULL)
      {
         marcusShadowBolt->mChance = 9.0f;
         marcusShadowBolt->mEnabled = true;
      }
      if (marcusBurningShadows != NULL)
      {
         marcusBurningShadows->mChance = 15.0f;
         marcusBurningShadows->mEnabled = true;
      }
               ParentClass::OnCombatStart(pTarget);
        
}
	void OnCombatStop(Unit* pTarget)
	{
		if(GetHealthPercent() >= 1)
		{   
   sEventMgr.AddEvent(TO_UNIT(GetUnit()), &Unit::SendChatMessage (uint8)CHAT_MSG_MONSTER_YELL, (uint32)LANG_UNIVERSAL, "Let The Darkness Flow Through Your Vains!", EVENT_UNIT_CHAT_MSG, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
   GetUnit()->SetHealthPct(100);
        }
                ParentClass::OnCombatStop(pTarget);
        }

	void OnDied(Unit* pKiller)
        {
                Emote("You Can Not Defeat Me! This Is Not The End!", Text_Yell);
                ParentClass::OnDied(pKiller);
        }
	void AIUpdate()
	{
		//Phase 2 (before death)
   if(GetHealthPercent() <= 3 && GetPhase() == 1)
                {
                   SetPhase(2);
		 wyrnn = SpawnCreature( KING_WYRNN );
	  if (wyrnn != NULL)
	  {
		  Emote("Wyrnn would be spawned here.", Text_Yell);
	  }

	  if (marcusVoidZones != NULL)
      {
         marcusVoidZones->mChance = 33.0f;
         marcusVoidZones->mEnabled = false;
      }
      if (marcusShadowBolt != NULL)
      {
         marcusShadowBolt->mChance = 9.0f;
         marcusShadowBolt->mEnabled = false;
      }
      if (marcusBurningShadows != NULL)
      {
         marcusBurningShadows->mChance = 15.0f;
         marcusBurningShadows->mEnabled = false;
	  }
	  if (MARCUS !=NULL)
	  {
		  MARCUS:Despawn(3000, 0);
                }
             ParentClass::AIUpdate();
   }
    protected:
      SpellDesc * marcusVoidZones;
      SpellDesc * marcusShadowBolt;
      SpellDesc * marcusBurningShadows;                 
};
	void SetupHumanQuestInstance(ScriptMgr * mgr)
{
        mgr->register_creature_script(MARCUS, &MarcusBossAI::Create);
}


Any ideas?

I tryed it declared as a MoonscriptAI already and it gave me the same errors
0

#2 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 03 November 2010 - 10:52 PM

Well without posting the error messages it's hard to help...
I am just a simple guy, not a psionic alien.
"The demand for free goods is infinite."
0

#3 User is offline   Elliott Quick 

  • Member
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 17-May 09
  • Gender:Male
  • Location:Grand Rapids, MI
  • Server OS:Windows

Posted 03 November 2010 - 11:07 PM

Sorry here you go
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\elliott\documents\arcemu\src\scripts\src\Common\base.h	365	1	ExtraScripts
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\elliott\documents\arcemu\src\scripts\src\Common\base.h	365	1	ExtraScripts
error C2143: syntax error : missing ';' before '*'	c:\users\elliott\documents\arcemu\src\scripts\src\Common\base.h	365	1	

This post has been edited by Elliott Quick: 03 November 2010 - 11:12 PM

0

#4 User is offline   Dzjhenghiz 

  • حشّاشين
  • Group: Contributor
  • Posts: 1,936
  • Joined: 07-June 08
  • Gender:Male
  • Location:2nd stone after the 3rd oase western sahara
  • Interests:M.C.S.E :- Minesweeper Consultant & Solitaire Expert
  • Server OS:Other

Posted 04 November 2010 - 01:04 AM

error c4430

Error C2143
Need Help With Arcemu ? ^^
Posted Image
Concordia res parvae crescunt In varietate concordia
Spoiler

0

#5 User is offline   Elliott Quick 

  • Member
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 17-May 09
  • Gender:Male
  • Location:Grand Rapids, MI
  • Server OS:Windows

Posted 04 November 2010 - 06:53 PM

View PostDzjhenghiz, on 04 November 2010 - 01:04 AM, said:



the error found in base.h is what confuzes me
0

#6 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 04 November 2010 - 11:26 PM

Assuming you are using the ExtraScripts project, why are you including StdAfx.h when Setup.h already includes it? Also did you randomly tried including Base.h without even checking how other projects include it, like http://sourceforge.n...Scripts/Setup.h ? It's not that hard to copypaste the includes of this header. Undesrtanding why each one is needed and why they are included in this order is a totally different yet required thing. You should learn C++ before trying to write C++ scripts for ArcEmu. If you didn't write this then you should ask to the author how to build it. Solving build errors is part of basic knowledge for each programming language.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#7 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 05 November 2010 - 10:57 AM

Well I was curious a bit so I added your script to my ExtraScript project and guess what I had lots of expressions underlined with red.
Meaning lots of syntax errors.
Some of them are due to you writing "ArcScriptXYZ" instead of "MoonScriptXYZ". (Even the mentioned guide says MoonScriptXYZ so I don't even know why you wrote ArcScript o.O )
Also you seem to be missing some curly brackets or have them at the wrong place.
Also you are missing at least 1 comma.
Also you define "MARCUS" as a number then you try to call a method on it, and with the wrong notation of that.

You have no idea wtf you are doing, do you?

All these seem to have been able to be avoided had you known "the C++ programming language" and the IDE. -.-
Those are really a must if you want to write C++ addons for Arcemu. Because you know a "C++ scripter" is a C++ programmer who creates addons.
"The demand for free goods is infinite."
0

#8 User is offline   Elliott Quick 

  • Member
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 17-May 09
  • Gender:Male
  • Location:Grand Rapids, MI
  • Server OS:Windows

Posted 05 November 2010 - 11:23 AM

I have limited knowledge in C++, I'll start working on learning the language before I work on scripts and ask for help on them. Sorry for wasting your guys time.
0

#9 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 05 November 2010 - 11:36 AM

View PostElliott Quick, on 05 November 2010 - 11:23 AM, said:

I have limited knowledge in C++, I'll start working on learning the language before I work on scripts and ask for help on them. Sorry for wasting your guys time.

No worries.
However learning C++ only for this is a waste since C++ is a fairly complex language, it's not easy to learn it.
If you are not a technical person, you probably don't even want to learn it.
If you are a creative person, you should probably find some technical person and work together, you come up with the ideas, they implement it ^^
In any case, good luck!
"The demand for free goods is infinite."
0

#10 User is offline   Elliott Quick 

  • Member
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 17-May 09
  • Gender:Male
  • Location:Grand Rapids, MI
  • Server OS:Windows

Posted 05 November 2010 - 11:44 AM

View Postdfighter, on 05 November 2010 - 11:36 AM, said:

No worries.
However learning C++ only for this is a waste since C++ is a fairly complex language, it's not easy to learn it.
If you are not a technical person, you probably don't even want to learn it.
If you are a creative person, you should probably find some technical person and work together, you come up with the ideas, they implement it ^^
In any case, good luck!


thanks Dfighter
I should start learning it anyway, I start classes on it next year and I'm sure and prior knowledge will help =)
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