ArcEmu: [Applied][arcscripts] Only 2 Small Fixes - 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

[Applied][arcscripts] Only 2 Small Fixes

#1 User is offline   MesoX 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 296
  • Joined: 15-June 08
  • Gender:Male
  • Location:Czech Republic
  • Interests:pc & girls & parties

Posted 19 February 2010 - 10:49 AM

First script fixes Wood Mites, which are not spawned (but needed for quest) and they should spawn from 2 npc in terrokar after their death.

Second script fix spawning of barell for Q A Plague upon thee. Before my update everytime u click on create it spawns barrel at your position, but it should spawn only once, only if you have quest active and not on your position but on top of box.

Index: MiscScripts/GameObjects.cpp
===================================================================
--- MiscScripts/GameObjects.cpp	(revision 1284)
+++ MiscScripts/GameObjects.cpp	(working copy)
@@ -694,8 +694,15 @@
 		if(!pPlayer)
 			return;
 
-		GameObject* barel = sEAS.SpawnGameobject(pPlayer, 177491, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 1, 0, 0, 0, 0);
-		sEAS.GameobjectDelete(barel, 2*60*1000);
+		if( pPlayer->GetQuestLogForEntry(5902) || pPlayer->GetQuestLogForEntry(5904) )
+		{
+			GameObject * go = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(), 177491);
+			if(!go)
+			{
+				GameObject * barel = sEAS.SpawnGameobject(pPlayer, 177491, 2449.51f, -1662.32f, 104.38f, 1.0f, 1, 0, 0, 0, 0);
+				sEAS.GameobjectDelete(barel, 2*60*1000);
+			}
+		}
 	}
 };
 
Index: QuestScripts/Quest_Terrokar_Forest.cpp
===================================================================
--- QuestScripts/Quest_Terrokar_Forest.cpp	(revision 1284)
+++ QuestScripts/Quest_Terrokar_Forest.cpp	(working copy)
@@ -56,22 +56,43 @@
   ADD_CREATURE_FACTORY_FUNCTION(TheInfestedProtectorsQAI);
   TheInfestedProtectorsQAI(Creature* pCreature) : CreatureAIScript(pCreature)  {}
       
-  void OnDied(Unit* mKiller)
-  {
-  	if(!mKiller->IsPlayer())
-	  return;
-	  
-  	Player* plr = TO_PLAYER(mKiller);
-	
-	if(!plr->GetQuestLogForEntry(10896))
-	  return;
-	
-	sEAS.SpawnCreature(plr, 22419, _unit->GetPositionX()+RandomFloat(3.0f), _unit->GetPositionY()+RandomFloat(3.0f), _unit->GetPositionZ(), RandomFloat(1.0f), 60*200);
-	sEAS.SpawnCreature(plr, 22419, _unit->GetPositionX()+RandomFloat(3.0f), _unit->GetPositionY()+RandomFloat(3.0f), _unit->GetPositionZ(), RandomFloat(1.0f), 60*200);
-	sEAS.SpawnCreature(plr, 22419, _unit->GetPositionX()+RandomFloat(3.0f), _unit->GetPositionY()+RandomFloat(3.0f), _unit->GetPositionZ(), RandomFloat(1.0f), 60*200);
-	sEAS.SpawnCreature(plr, 22419, _unit->GetPositionX()+RandomFloat(3.0f), _unit->GetPositionY()+RandomFloat(3.0f), _unit->GetPositionZ(), RandomFloat(1.0f), 60*200);
-	sEAS.SpawnCreature(plr, 22419, _unit->GetPositionX()+RandomFloat(3.0f), _unit->GetPositionY()+RandomFloat(3.0f), _unit->GetPositionZ(), RandomFloat(1.0f), 60*200);
-  }
+	void OnDied(Unit * mKiller)
+	{
+		if(mKiller->IsPlayer())
+		{
+			Player * plr = TO_PLAYER(mKiller);
+			if(plr->GetQuestLogForEntry(10896))
+			{
+				if(Rand(90))
+				{
+					uint32 min,max,finall;
+					switch(_unit->GetEntry())
+					{
+						case 22307:
+							min = 4; max = 11;
+							break;
+						case 22095:
+							min = 2; max = 5;
+							break;
+					}
+
+					finall = min + RandomUInt(max - min);
+
+					float SSX = _unit->GetPositionX();
+					float SSY = _unit->GetPositionY();
+					float SSZ = _unit->GetPositionZ();
+					float SSO = _unit->GetOrientation();
+
+					for(uint8 i = 0; i < finall; i++)
+					{
+						Creature * NewCreature = _unit->GetMapMgr()->GetInterface()->SpawnCreature(22419, SSX, SSY, SSZ, SSO, true, false, 0, 0);
+						if ( NewCreature != NULL )
+							NewCreature->Despawn(120000, 0);
+					}
+				}
+			}
+		}
+	}
 };
 
 // Taken in the Night


DELETE FROM creature_spawns WHERE entry = 22419;
DELETE FROM gameobject_spawns WHERE entry IN (177491, 177490);
INSERT INTO `gameobject_spawns` (`id`, `Entry`, `map`, `position_x`, `position_y`, `position_z`, `Facing`, `orientation1`, `orientation2`, `orientation3`, `orientation4`, `State`, `Flags`, `Faction`, `Scale`, `stateNpcLink`, `phase`, `overrides`) VALUES
(NULL, 177490, 0, 2449.44, -1662.34, 103.127, 0.261799, 0, 0, 0.130526, 0.991445, 1, 0, 35, 1, 0, 1, 0);

Attached File(s)


Posted Image
1

#2 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 19 February 2010 - 02:42 PM

if(rand()%90) // 90% chance to spawn


(rand()%90) has 1 chance in 90 to be false, so it has 100 - (100/90)*1 = 98.8888888888889 chances to be true, that is NOT 90%.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
1

#3 User is offline   MesoX 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 296
  • Joined: 15-June 08
  • Gender:Male
  • Location:Czech Republic
  • Interests:pc & girls & parties

Posted 19 February 2010 - 03:55 PM

thanks i accidentaly used another function.
Posted Image
0

#4 User is offline   alleycat 

  • Helps so much & is so mature & gay
  • PipPipPipPipPip
  • Group: Members
  • Posts: 835
  • Joined: 25-July 08
  • Gender:Male

Posted 29 March 2010 - 11:13 AM

This patch has been approved by a QA.
This thread is has been moved to the approved patches forum.
I can haz cookie?
0

#5 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 12 May 2010 - 01:48 PM

why did you add this to MiscScripts, when it's obviously a QuestScript?
also both Creature 22307 and 22095 are already handled in http://arcemu.info/t...est.cpp?rev=924 by TheInfestedProtectorsQAI, so edit/remove the old script.
Note for Alleycat: how didn't you see both creatures were already handled in another script?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#6 User is offline   MesoX 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 296
  • Joined: 15-June 08
  • Gender:Male
  • Location:Czech Republic
  • Interests:pc & girls & parties

Posted 13 May 2010 - 03:11 PM

updated
Posted Image
0

#7 User is offline   iEzri 

  • < Ace of spades >
  • Group: Contributor
  • Posts: 1,692
  • Joined: 22-December 08
  • Gender:Female
  • Interests:I'm likely to cause mischief
  • Server OS:Linux

Posted 22 May 2010 - 10:29 AM

hm, it seems to work but there are things i still wonder about:

- Where did you get those values from, like the 90% or the amount of mites?
- the group thingie seems unhandeled.
- why do they attack the player?
- why are they all spawned exactly on the same spot? this makes it look like it was only 1 mob...

i saw some comments on wowhead on this quest:

Quote

If you kill big walking trees that looks like ancients 6-8 of Wood Mites will spawn. If you kill small ones trents 4-5 Wood Mite's will come.

then

Quote

If you are in a group with someone who has already completed this quest, the mites will not come out of the trees.

and

Quote

Paladins beware: the termites do not attack you when they spawn, so retribution aura wont work.


im not sure on this, so could you give me some info ?
Posted Image I do not join. I lead.
0

#8 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 23 May 2010 - 04:51 AM

at least the old script had a "+ RandomFloat(3.0f)"
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#9 User is offline   MesoX 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 296
  • Joined: 15-June 08
  • Gender:Male
  • Location:Czech Republic
  • Interests:pc & girls & parties

Posted 24 May 2010 - 02:21 PM

I tested this quest on retail and mites spawned on the same position where tree died, i can't post there screenshot, as I already finished that quest and i can't just make new char and test it.

About 90% - thats a bit weird, but when i was testing it, once i didn't get mites from that tree, i don't know if it is blizz bug or what, but some friends told me that it was same for them, that sometimes mites didn't spawn.

About groups - sorry i didn't know it. I will update it.

About counts - i killed more than 40 trees so i clearly saw how many mites came out from the tree, values are mostly real from my researches on this quest.

About attacking player - this is faction issue isn't ? and then it's DB issue isn't ?
Posted Image
0

#10 User is offline   Ogchaos 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 404
  • Joined: 30-September 09

Posted 24 May 2010 - 03:01 PM

View PostMesoX, on 24 May 2010 - 02:21 PM, said:

About attacking player - this is faction issue isn't ? and then it's DB issue isn't ?


They are supposed to be hostile.

http://www.wowwiki.com/Wood_Mite
0

#11 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 02 September 2011 - 03:35 PM

for "A Plague upon thee", how am I supposed to finish the quest? I click on the crate, the barrel spawns, then? The crate has type GAMEOBJECT_TYPE_QUESTGIVER but has no quests (using whydb, so db issue?)

View Postjackpoz, on 28 August 2011 - 05:40 PM, said:

for "A Plague upon thee", how am I supposed to finish the quest? I click on the crate, the barrel spawns, then? The crate has type GAMEOBJECT_TYPE_QUESTGIVER but has no quests (using whydb, so db issue?)

fixed in r4510 http://sourceforge.n.../changeset/4510

View PostiEzri, on 22 May 2010 - 10:29 AM, said:

- why are they all spawned exactly on the same spot? this makes it look like it was only 1 mob...


View Postjackpoz, on 23 May 2010 - 04:51 AM, said:

at least the old script had a "+ RandomFloat(3.0f)"


added "+ RandomFloat(3.0f)" to X and Y coordinate to Wood Mite positions.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#12 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 02 September 2011 - 03:37 PM

- Applied.
- Moved to applied patches.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
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