mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Cleaned up the new scripting code. Added a helper function to do the yielding automatically. Modified all the scripts to use the new system and added a few new ones.
This commit is contained in:
		| @@ -1,11 +1,10 @@ | ||||
| require ("global") | ||||
|  | ||||
| function init(npc) | ||||
| 	return false, false, 0, 0;	 | ||||
| end | ||||
|  | ||||
| function onEventStarted(player, npc, triggerName) | ||||
| 	player:RunEventFunction("bookTalk"); | ||||
| 	player:callClientFunction(player, "bookTalk"); | ||||
| 	player:EndEvent(); | ||||
| end | ||||
|  | ||||
| function onEventUpdate(player, npc, step, menuOptionSelected) | ||||
| 	player:EndEvent();	 | ||||
| end | ||||
| @@ -1,25 +1,21 @@ | ||||
| require ("global") | ||||
|  | ||||
| function init(npc) | ||||
| 	return false, false, 0, 0;	 | ||||
| end | ||||
|  | ||||
| function onEventStarted(player, npc, triggerName) | ||||
| 	player:RunEventFunction("askLogout", player); | ||||
| end | ||||
|  | ||||
| function onEventUpdate(player, npc, eventStep, menuOptionSelected)	 | ||||
| 	choice = callClientFunction(player, "askLogout", player); | ||||
| 	 | ||||
| 	if (menuOptionSelected == 1) then  | ||||
| 		player:EndEvent(); | ||||
| 		return; | ||||
| 	elseif (menuOptionSelected == 2) then | ||||
| 	if (choice == 2) then | ||||
| 		player:QuitGame(); | ||||
| 	elseif (menuOptionSelected == 3) then | ||||
| 	elseif (choice == 3) then | ||||
| 		player:Logout(); | ||||
| 	elseif (menuOptionSelected == 4) then | ||||
| 	elseif (choice == 4) then | ||||
| 		player:SendMessage(33, "", "Heck the bed"); | ||||
| 	end 	 | ||||
| 	end | ||||
| 	 | ||||
| 	player:EndEvent(); | ||||
| 		 | ||||
| 	 | ||||
| end | ||||
| @@ -1,3 +1,4 @@ | ||||
| require ("global") | ||||
|  | ||||
| function init(npc) | ||||
| 	return false, false, 0, 0;	 | ||||
| @@ -5,15 +6,11 @@ end | ||||
|  | ||||
| function onEventStarted(player, npc, triggerName) | ||||
| 	defaultFst = GetStaticActor("DftFst"); | ||||
| 	player:RunEventFunction("delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil); | ||||
| end | ||||
|  | ||||
| function onEventUpdate(player, npc, resultId, isExitYes) | ||||
|  | ||||
| 	if (isExitYes ~= nil and isExitYes == 1) then | ||||
| 	choice = callClientFunction(player, "delegateEvent", player, defaultFst, "defaultTalkWithInn_ExitDoor", nil, nil, nil); | ||||
| 	 | ||||
| 	if (choice == 1) then | ||||
| 		GetWorldManager():DoZoneChange(player, 1); | ||||
| 	else | ||||
| 		player:EndEvent(); | ||||
| 	end | ||||
| 	 | ||||
| 	player:EndEvent();	 | ||||
| end | ||||
		Reference in New Issue
	
	Block a user