mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	added helpers for DoW/DoM/DoH/DoH
- fixed allies not being able to aggro on roam - fixed static characters aggroing
This commit is contained in:
		| @@ -11,78 +11,54 @@ function init() | ||||
| end | ||||
|  | ||||
| function onCreateContentArea(players, director, contentArea, contentGroup) | ||||
|  | ||||
|     local worldManager = GetWorldManager(); | ||||
|     --[[ | ||||
|     --yda = GetWorldManager().SpawnBattleNpcById(6, contentArea); | ||||
|     --papalymo = GetWorldManager().SpawnBattleNpcById(7, contentArea); | ||||
|     --yda:ChangeState(2); | ||||
|     mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea); | ||||
|     mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea); | ||||
|     mob3 = GetWorldManager().SpawnBattleNpcById(5, contentArea); | ||||
|  | ||||
|     --papalymo = contentArea:SpawnActor(2290005, "papalymo", 365.89, 4.0943, -706.72, -0.718); | ||||
| 	--yda = contentArea:SpawnActor(2290006, "yda", 365.266, 4.122, -700.73, 1.5659);	 | ||||
| 	--yda:ChangeState(2); | ||||
| 	 | ||||
| 	--mob1 = contentArea:SpawnActor(2201407, "mob1", 374.427, 4.4, -698.711, -1.942); | ||||
| 	--mob2 = contentArea:SpawnActor(2201407, "mob2", 375.377, 4.4, -700.247, -1.992); | ||||
| 	--mob3 = contentArea:SpawnActor(2201407, "mob3", 375.125, 4.4, -703.591, -1.54); | ||||
| 	 | ||||
| 	openingStoper = contentArea:SpawnActor(1090384, "openingstoper", 356.09, 3.74, -701.62, -1.41); | ||||
| 	 | ||||
|      | ||||
|     local added = false; | ||||
|     for player in players do | ||||
|         if player.currentParty and not added then | ||||
|             player.currentParty.members:Add(yda.actorId); | ||||
|             print("cunt"); | ||||
|             player.currentParty.members:Add(papalymo.actorId); | ||||
|             print("dickbag"); | ||||
|             added = true; | ||||
|         end; | ||||
|         -- dont let player die | ||||
|         print("shittttt3"); | ||||
|         player:SetMod(modifiersGlobal.MinimumHpLock, 1); | ||||
|         print("shittttt2"); | ||||
|         director:AddMember(player) | ||||
|         print("shittttt1"); | ||||
|     end; | ||||
|     print("shit") | ||||
|     director:AddMember(director); | ||||
|     director:AddMember(yda); | ||||
|     director:AddMember(papalymo); | ||||
|     director:AddMember(mob1); | ||||
|     director:AddMember(mob2); | ||||
|     print("shit6") | ||||
|     director:AddMember(mob3); | ||||
|     print("dicks") | ||||
| ]] | ||||
| 	director:StartContentGroup(); | ||||
| end | ||||
|  | ||||
| function onEventStarted(player, actor, triggerName)	 | ||||
|  | ||||
| function onEventStarted(player, actor, triggerName) | ||||
| 	man0g0Quest = player:GetQuest("Man0g0"); | ||||
| 	startTutorialMode(player); | ||||
| 	callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl001", nil, nil, nil); | ||||
| 	player:EndEvent(); | ||||
| 	waitForSignal("playerActive"); | ||||
| 	wait(2); --If this isn't here, the scripts bugs out. TODO: Find a better alternative. | ||||
| 	wait(1); --If this isn't here, the scripts bugs out. TODO: Find a better alternative. | ||||
| 	kickEventContinue(player, actor, "noticeEvent", "noticeEvent");	 | ||||
| 	callClientFunction(player, "delegateEvent", player, man0g0Quest, "processTtrBtl002", nil, nil, nil); | ||||
| 	player:EndEvent(); | ||||
|      | ||||
| 	waitForSignal("playerAttack"); | ||||
| 	closeTutorialWidget(player); | ||||
| 	showTutorialSuccessWidget(player, 9055); --Open TutorialSuccessWidget for attacking enemy | ||||
| 	wait(3); | ||||
|      | ||||
|     man0g0Quest:NextPhase(5); | ||||
| 	openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_TP); | ||||
|     wait(5); | ||||
| 	 | ||||
|     man0g0Quest:NextPhase(6); | ||||
| 	waitForSignal("tpOver1000"); | ||||
| 	closeTutorialWidget(player); | ||||
| 	print("ass") | ||||
| 	openTutorialWidget(player, CONTROLLER_KEYBOARD, TUTORIAL_WEAPONSKILLS); | ||||
|  | ||||
| 	if player:IsDiscipleOfWar() then | ||||
| 		waitForSignal("weaponskillUsed"); --Should be wait for weaponskillUsed signal | ||||
| 	elseif player:IsDiscipleOfMagic() then | ||||
| 		waitForSignal("spellUsed") | ||||
| 	elseif player:IsDiscipleOfHand() then | ||||
| 		waitForSignal("abilityUsed") | ||||
| 	elseif player:IsDiscipleOfLand() then | ||||
| 		waitForSignal("abilityUsed") | ||||
| 	end | ||||
| 	closeTutorialWidget(player); | ||||
| 	showTutorialSuccessWidget(player, 9065); --Open TutorialSuccessWidget for weapon skill | ||||
| 	 | ||||
| 	waitForSignal("mobkill"); --Should be wait for mobkill | ||||
| 	waitForSignal("mobkill"); | ||||
| 	waitForSignal("mobkill"); | ||||
| 	worldMaster = GetWorldMaster(); | ||||
| 	player:SendDataPacket("attention", worldMaster, "", 51073, 2); | ||||
| 	wait(7); | ||||
| 	player:ChangeMusic(7); | ||||
| 	player:ChangeState(0);  | ||||
| 	kickEventContinue(player, actor, "noticeEvent", "noticeEvent"); | ||||
| 	callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent020_1", nil, nil, nil); | ||||
| 	 | ||||
| 	player:GetZone():ContentFinished(); | ||||
|     player:EndEvent(); | ||||
|     GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 1, 15, 175.38, -1.21, -1156.51, -2.1); | ||||
| 	--[[ | ||||
| 	IF DoW: | ||||
| 		OpenWidget (TP) | ||||
| @@ -104,7 +80,6 @@ function onEventStarted(player, actor, triggerName) | ||||
| end | ||||
|  | ||||
| function onUpdate(deltaTime, area) | ||||
|     print("fuck") | ||||
| end | ||||
|  | ||||
| function onTalkEvent(player, npc) | ||||
| @@ -125,6 +100,5 @@ function onCommand(player, command) | ||||
| end | ||||
|  | ||||
| function main(director, contentGroup) | ||||
|     print("shitstain") | ||||
|     onCreateContentArea(director:GetPlayerMembers(), director, director:GetZone(), contentGroup); | ||||
| end; | ||||
| @@ -116,6 +116,14 @@ DAMAGE_TAKEN_TYPE_MAGIC = 2; | ||||
| DAMAGE_TAKEN_TYPE_WEAPONSKILL = 3; | ||||
| DAMAGE_TAKEN_TYPE_ABILITY = 4; | ||||
|  | ||||
| -- CLASSID | ||||
| CLASSID_PUG = 2; | ||||
| CLASSID_GLA = 3; | ||||
| CLASSID_MRD = 4; | ||||
| CLASSID_ARC = 7; | ||||
| CLASSID_LNC = 8; | ||||
| CLASSID_THM = 22; | ||||
| CLASSID_CNJ = 23; | ||||
|  | ||||
|  | ||||
| --UTILS | ||||
|   | ||||
| @@ -1,58 +0,0 @@ | ||||
| require ("global") | ||||
| require ("modifiers") | ||||
| require ("ally") | ||||
|  | ||||
| function onSpawn(mob) | ||||
|  | ||||
| end; | ||||
|  | ||||
| function onDamageTaken(mob, attacker, damage, damageType) | ||||
|     if attacker.IsPlayer() then | ||||
|         local man0g0Quest = attacker:GetQuest("Man0g0"); | ||||
|         if damageType == DAMAGE_TAKEN_TYPE_ATTACK then | ||||
|             if man0g0Quest:GetPhase() == 5 then | ||||
|                 closeTutorialWidget(player); | ||||
|             	showTutorialSuccessWidget(player, 9055); --Open TutorialSuccessWidget for attacking enemy | ||||
|                 man0g0Quest:NextPhase(6); | ||||
|             end; | ||||
|         elseif damageType == DAMAGE_TAKEN_TYPE_WEAPONSKILL or damageType == DAMAGE_TAKEN_TYPE_MAGIC then | ||||
|             if man0g0Quest:GetPhase() == 6 then | ||||
|                 closeTutorialWidget(player); | ||||
|                 showTutorialSuccessWidget(player, 9065); --Open TutorialSuccessWidget for weapon skill | ||||
|                 man0g0Quest:NextPhase(7); | ||||
|             end; | ||||
|         end; | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| function onDeath(mob, player, lastAttacker) | ||||
|     if player then | ||||
|         local man0g0Quest = player:GetQuest("Man0g0"); | ||||
|         if man0g0Quest and man0g0Quest:GetPhase() >= 7 then | ||||
|             man0g0Quest:NextPhase(man0g0Quest:GetPhase() + 1); | ||||
|             mob:SetTempVar("playerId", player.actorId); | ||||
|             if man0g0Quest:GetPhase() == 10 then | ||||
|             	local worldMaster = GetWorldMaster(); | ||||
|                 player:SendDataPacket("attention", worldMaster, "", 51073, 1); | ||||
|                 kickEventContinue(player, director, "noticeEvent", "noticeEvent"); | ||||
|                 callClientFunction(player, "delegateEvent", player, man0g0Quest, "processEvent020_1", nil, nil, nil);	 | ||||
|                 player:ChangeMusic(7); | ||||
|                 player:Disengage(0x0000); | ||||
|                 mob:SetTempVar("complete", 1); | ||||
|             end; | ||||
|         end; | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| function onDespawn(mob) | ||||
|     if zone then | ||||
|         local player = zone.FindActorInArea(mob:GetTempVar("playerId")); | ||||
|          | ||||
|         if player and mob:GetTempVar("complete") == 1 then | ||||
|             local man0g0Quest = player:GetQuest("Man0g0"); | ||||
|             player:GetZone():ContentFinished(); | ||||
|             player:EndEvent(); | ||||
|             GetWorldManager():DoZoneChange(player, 155, "PrivateAreaMasterPast", 1, 15, 175.38, -1.21, -1156.51, -2.1); | ||||
|         end; | ||||
|     end; | ||||
| end; | ||||
| @@ -1,11 +1,22 @@ | ||||
| require ("global") | ||||
|  | ||||
| require ("ally") | ||||
|  | ||||
| function onSpawn(ally) | ||||
|     ally:SetMaxHP(69420) | ||||
|     ally:SetHP(ally:GetMaxHP()) | ||||
|     ally.isAutoAttackEnabled = false; | ||||
| end; | ||||
|     ally.neutral = false | ||||
| end | ||||
|  | ||||
| function onCombatTick(ally, target, tick, contentGroupCharas)	 | ||||
|     allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas); | ||||
| end; | ||||
| end | ||||
|  | ||||
|  | ||||
| function onRoam(ally, contentGroupCharas) | ||||
|     ally.detectionType = 0xFF | ||||
|     ally.isMovingToSpawn = false | ||||
|     ally.neutral = false | ||||
|     ally.animationId = 0 | ||||
|     allyGlobal.onCombatTick(ally, nil, nil, contentGroupCharas) | ||||
| end | ||||
| @@ -3,9 +3,20 @@ require ("global") | ||||
| require ("ally") | ||||
|  | ||||
| function onSpawn(ally) | ||||
|     ally:SetMaxHP(69420) | ||||
|     ally:SetHP(ally:GetMaxHP()) | ||||
|     ally.isAutoAttackEnabled = false | ||||
|     ally.neutral = false | ||||
| end | ||||
|  | ||||
| function onCombatTick(ally, target, tick, contentGroupCharas)	 | ||||
|     allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas) | ||||
| end | ||||
|  | ||||
| function onRoam(ally, contentGroupCharas) | ||||
|     ally.detectionType = 0xFF | ||||
|     ally.isMovingToSpawn = false | ||||
|     ally.neutral = false | ||||
|     ally.animationId = 0 | ||||
|     allyGlobal.onCombatTick(ally, contentGroupCharas) | ||||
| end | ||||
		Reference in New Issue
	
	Block a user