Hi everyone, this is a story script I wrote a while ago to integrate hooks for object scripts into story scripting-specific functions. The original intent was to get around old story script limitations, but those problems have (largely) been removed. Since then, I have continued to use the script, as it has from time-to-time served as a very natural way to join the two scripting modes, and has saved me time.

I figure it may be helpful to some of you for the same reason, or even just to use before getting a better handle on story scripting. The general idea is to raise the relevant event after having initialized the relevant variables (essentially working as function parameters) within your object script. Story then calls the function you want and all is well. There is also an optional variable, %AMER_WRAP_PARAM_ReturnEvent, to set a return event which your object script can catch and act upon at the function's completion. Here's the code:


Code
Version 1
SubGoalCombiner SGC_AND
INITSECTION

KBSECTION
//==========================================================//
//                                                          //
//     S T O R Y   S C R I P T I N G    W R A P P E R S     //
//                                                          //
//     Written by Matteo "Ameranth" T. (2017)               //
//==========================================================//
//I've made an effort create wrappers for useful story script-only
//functionality that can be called from object scripts. This helps
//facilitate an easier joining of two script types when it is necessary.
//To use, simply add the relevant global variables to the calling
//the script, initialize them as parameters, and throw the desired
//event.



//REGION Return Event
//Because the raised event is unlikely to be handled before any
//subsequent script of the calling object is, a "return event"
//can be thrown after most of these events are completed. In the case
//that it is important to wait for completion, these may prove useful.
//Simply include and initialize %AMER_WRAP_PARAM_ReturnEvent within
//the calling script before throwing the desired event.
//It is not the responsibility of this script to clear this variable.
PROC
PROC_AMER_WRAP_Return((GUIDSTRING)_Caller)
AND
GetVarString(_Caller, "AMER_WRAP_PARAM_ReturnEvent", _ReturnEventID)
AND
_ReturnEventID != ""
THEN
SetStoryEvent(_Caller, _ReturnEventID);
//END_REGION




//REGION Override Maximum Source Points:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_OverrideMaxSourcePoints")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterOverrideMaxSourcePoints(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Ability:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddAbility")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Ability)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddAbility(_Target, _Ability, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Ability Point:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddAbilityPoint")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddAbilityPoint(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Ability:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveAbility")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Ability)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterRemoveAbility(_Target, _Ability, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Lock Ability:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_LockAbility")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Ability)
THEN
CharacterLockAbility(_Target, _Ability);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Ability:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UnlockAbility")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Ability)
THEN
CharacterUnlockAbility(_Target, _Ability);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Attribute:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddAttribute")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Attribute)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddAttribute(_Target, _Attribute, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Attribute Point:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddAttributePoint")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddAttributePoint(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Attribute:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveAttribute")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Attribute)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterRemoveAttribute(_Target, _Attribute, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Talent:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddTalent")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Talent)
THEN
CharacterAddTalent(_Target, _Talent);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Talent Point:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddTalentPoint")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddTalentPoint(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Talent:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveTalent")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Talent)
THEN
CharacterRemoveTalent(_Target, _Talent);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Freeze:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Freeze")
THEN
CharacterFreeze(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unfreeze:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Unfreeze")
THEN
CharacterUnfreeze(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Destroy Ghost:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Destroy Ghost")
THEN
DestroyGhost(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Disable Pyramid:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_DisablePyramid")
THEN
DisablePyramid(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Enable Pyramid:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_EnablePyramid")
THEN
EnablePyramid(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Foop:
//I have absolutely no clue what Foop is, but why not include it, right?
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Foop")
THEN
Foop(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_Foop")
THEN
Foop(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Poof:
//I have absolutely no clue what Poof is, but why not include it, right?
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Poof")
THEN
Poof(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_Poof")
THEN
Poof(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Get User Profile ID:
IF
StoryEvent(_GUID, "AMER_WRAP_GetUserProfileID")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UserID)
AND
GetUserProfileID(_UserID, _ProfileID)
THEN
SetVarString((CHARACTERGUID)_GUID, "AMER_WRAP_OUT_STR", _ProfileID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Get User Name:
IF
StoryEvent(_GUID, "AMER_WRAP_GetUserName")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UserID)
AND
GetUserName(_UserID, _UserName)
THEN
SetVarString((CHARACTERGUID)_GUID, "AMER_WRAP_OUT_STR", _UserName);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Get Character Display Name:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_GetCharacterDisplayName")
AND
CharacterGetDisplayName(_Target, _StringHandle, _StringRef)
THEN
SetVarString((CHARACTERGUID)_GUID, "AMER_WRAP_OUT_STR", _StringRef);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Item Set Known:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_ItemSetKnown")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Bool)
THEN
ItemSetKnown(_Target, _Bool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Lock Secret Region:
IF
StoryEvent(_GUID, "AMER_WRAP_LockSecretRegion")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_TRIGGUID", _Region)
THEN
LockSecretRegion((TRIGGERGUID)_Region);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Secret Region:
IF
StoryEvent(_GUID, "AMER_WRAP_UnlockSecretRegion")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_TRIGGUID", _Region)
THEN
UnlockSecretRegion((TRIGGERGUID)_Region);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Lock Waypoint:
IF
CharacterCharacterEvent(_GUID, _ForWho, "AMER_WRAP_LockWaypoint")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Waypoint)
THEN
LockWaypoint(_Waypoint, _ForWho);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Waypoint:
IF
CharacterCharacterEvent(_GUID, _ForWho, "AMER_WRAP_UnlockWaypoint")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Waypoint)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_TRIGGUID", _Trigger)
THEN
UnlockWaypoint(_Waypoint, (TRIGGERGUID)_Trigger, _ForWho);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Register Waypoint:
IF
CharacterItemEvent(_GUID, _Item, "AMER_WRAP_RegisterWaypoint")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Waypoint)
THEN
RegisterWaypoint(_Waypoint, _Item);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Open Waypoint UI:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_OpenWaypointUI")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _CurrentWaypoint)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
THEN
OpenWaypointUI(_Target, _CurrentWaypoint, (ITEMGUID)_Item);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Make Player Active:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_MakePlayerActive")
THEN
MakePlayerActive(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Movie Play:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_MoviePlay")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
MoviePlay(_Target, _Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION New Hour:
IF
StoryEvent(_GUID, "AMER_WRAP_NewHour")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Hour)
THEN
NewHour(_Hour);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION End Combat:
IF
StoryEvent(_GUID, "AMER_WRAP_EndCombat")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _CombatID)
THEN
EndCombat(_CombatID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Reset Insults:
IF
CharacterCharacterEvent(_GUID, _Char1, "AMER_WRAP_ResetInsults")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Char2)
THEN
ResetInsults(_Char1, (CHARACTERGUID)_Char2);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Game Clock:
IF
StoryEvent(_GUID, "AMER_WRAP_SetGameClock")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Time)
THEN
SetGameClock(_Time);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Update Time:
IF
StoryEvent(_GUID, "AMER_WRAP_UpdateTime")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Time1)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _Time2)
THEN
UpdateTime(_Time1, _Time2);		//Not sure of the distinction between the two variables here.
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Game End Movie:
IF
StoryEvent(_GUID, "AMER_WRAP_SetGameEndMovie")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UserID)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Movie)
THEN
SetGameEndMovie(_UserID, _Movie);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Arena Result:
IF
StoryEvent(_GUID, "AMER_WRAP_ShowArenaResult")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _TeamID)
THEN
ShowArenaResult(_TeamID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Credits:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ShowCredits")
THEN
ShowCredits(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Game Over Menu:
IF
StoryEvent(_GUID, "AMER_WRAP_ShowGameOverMenu")
THEN
ShowGameOverMenu();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Map Marker:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ShowMapMarker")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _MarkerID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ShowBool)
THEN
ShowMapMarker(_Target, _MarkerID, _ShowBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Notification:
IF
StoryEvent(_GUID, "AMER_WRAP_ShowNotification")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Text)
THEN
ShowNotification(_Text);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Display Text With Param:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_DisplayTextWithParam")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Text)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Param)
THEN
CharacterDisplayTextWithParam(_Target, _Text, _Param);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Shroud Render:
IF
StoryEvent(_GUID, "AMER_WRAP_ShroudRender")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _EnableBool)
THEN
ShroudRender(_EnableBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Start Voice Bark:
IF
CharacterCharacterEvent(_GUID, _Source, "AMER_WRAP_StartVoiceBark")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Bark)
THEN
StartVoiceBark(_Bark, _Source);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Phys Armor Percentage:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetPhysArmorPercentage")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Percentage)
THEN
CharacterSetArmorPercentage(_Target, _Percentage);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Magic Armor Percentage:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetMagicArmorPercentage")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Percentage)
THEN
CharacterSetMagicArmorPercentage(_Target, _Percentage);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Recipe:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UnlockRecipe")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _RecipeID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ShowNotificationBool)
THEN
CharacterUnlockRecipe(_Target, _RecipeID, _ShowNotificationBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Journal Recipe:
IF
StoryEvent(_GUID, "AMER_WRAP_UnlockJournalRecipe")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _RecipeID)
THEN
UnlockJournalRecipe(_RecipeID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Tutorial:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ShowTutorial")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Text)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Category)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR3", _Title)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ControllerType)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _ModalType)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _Duration)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT4", _Priority)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT5", _Flags)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT6", _MinPlaytime)
THEN
ShowTutorial(_Target, _Text, _Category, _Title, _ControllerType, _ModalType, _Duration, _Priority, _Flags, _MinPlaytime);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Progress Achievement:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ProgressAchievement")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _AchievementID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Progress)
THEN
ProgressAchievement(_Target, _AchievementID, _Progress);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlock Achievement:
IF
StoryEvent(_GUID, "AMER_WRAP_UnlockAchievement")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _AchievementID)
THEN
UnlockAchievement(_AchievementID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Notify Game Progress:
IF
StoryEvent(_GUID, "AMER_WRAP_NotifyGameProgress")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Progress)
THEN
NotifyGameProgress(_Progress);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Show Story Element UI:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ShowStoryElementUI")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Type)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Instance)
THEN
CharacterShowStoryElementUI(_Target, _Type, _Instance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Give Reward:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_GiveReward")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Treasure)
THEN
CharacterGiveReward(_Target, _Treasure);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Camera Distance Override:
IF
StoryEvent(_GUID, "AMER_WRAP_SetCameraDistanceOverride")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Distance)
THEN
SetCameraDistanceOverride(_Distance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Play HUD Sound:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_PlayHUDSound")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Sound)
THEN
CharacterPlayHUDSound(_Target, _Sound);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Play Beam Effect:
IF
CharacterCharacterEvent(_GUID, _Source, "AMER_WRAP_PlayBeamEffect")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Target)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Effect)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _SourceBone)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR3", _TargetBone)
THEN
PlayBeamEffect(_Source, _Target, _Effect, _SourceBone, _TargetBone);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Play Loop Beam Effect:
//Disable because there is no call to set an INTEGER64 variable.
/*
IF
StoryEvent(_GUID, "AMER_WRAP_PlayLoopBeamEffect")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID", _Source)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID2", _Target)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Effect)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _SourceBone)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR3", _TargetBone)
THEN
PlayLoopBeamEffect(_Source, _Target, _Effect, _SourceBone, _TargetBone, _OUTHandle);
SetVarInteger(_GUID, "AMER_WRAP_OUT_INT64", _OUTHandle);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
*/
//END_REGION

//REGION Unconsume:
//Disabled because there is no query for INTEGER64 variables.
/*
IF
StoryEvent(_GUID, "AMER_WRAP_Unconsume")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID", _Target)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT64", _Handle)
THEN
CharacterUnconsume((CHARACTERGUID)_Target, _Handle);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
*/
//END_REGION

//REGION Load Game:
IF
StoryEvent(_GUID, "AMER_WRAP_LoadGame")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _SaveName)
THEN
LoadGame(_SaveName);
//PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);	//Seems silly to throw a return event, as the game will be loading.
//END_REGION

//REGION AutoSave:
IF
StoryEvent(_GUID, "AMER_WRAP_AutoSave")
THEN
AutoSave();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Open Custom Book UI:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_OpenCustomBookUI")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _BookName)
THEN
OpenCustomBookUI(_Target, _BookName);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Entry to Custom Book
IF
StoryEvent(_GUID, "AMER_WRAP_AddEntryToCustomBook")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Bookname)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Entryname)
THEN
AddEntryToCustomBook(_Bookname, _Entryname);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Entry from Custom Book
IF
StoryEvent(_GUID, "AMER_WRAP_RemoveEntryFromCustomBook")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Bookname)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Entryname)
THEN
RemoveEntryFromCustomBook(_Bookname, _Entryname);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Maximum Source Point Override:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveMaxSourcePoints")
THEN
CharacterRemoveMaxSourcePointsOverride(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Reserve Polymorph Shape:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ReservePolymorphShape")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Race)
THEN
CharacterReservePolymorphShape(_Target, _Race);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Exploration Experience:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddExplorationExperience")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Act)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _ActPart)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _Gain)
THEN
CharacterAddExplorationExperience(_Target, _Act, _ActPart, _Gain);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Actual Experience:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddActualExperience")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _EXP)
THEN
PartyAddActualExperience(_Target, _EXP);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add To Player Character:
IF
CharacterCharacterEvent(_GUID, _Owner, "AMER_WRAP_AddToPlayerCharacter")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Slave)
THEN
CharacterAddToPlayerCharacter((CHARACTERGUID)_Slave, _Owner);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Can Trade:
IF
CharacterCharacterEvent(_GUID, _Trader, "AMER_WRAP_SetCanTrade")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Bool)
THEN
CharacterSetCanTrade(_Trader, _Bool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Activate Trade:
IF
CharacterCharacterEvent(_GUID, _Trader, "AMER_WRAP_ActivateTrade")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Customer)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _CanRepair)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _CanIdentify)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _CanSell)
THEN
ActivateTrade((CHARACTERGUID)_Customer, _Trader, _CanRepair, _CanIdentify, _CanSell);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Play Animation:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_PlayAnimation")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Animation)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Event)
THEN
PlayAnimation(_Target, _Animation, _Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_PlayAnimation")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Animation)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Event)
THEN
PlayAnimation(_Target, _Animation, _Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Has Dialog:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetHasDialog")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DialogID)
THEN
SetHasDialog(_Target, _DialogID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_SetHasDialog")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DialogID)
THEN
SetHasDialog(_Target, _DialogID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Start Dialog Internal:
IF
CharacterCharacterEvent(_GUID, _Speaker1, "AMER_WRAP_StartDialogInternal")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Dialog)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _MarkInteractiveBool)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Speaker2)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID2", _Speaker3)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID3", _Speaker4)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID4", _Speaker5)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID5", _Speaker6)
AND
StartDialog_Internal(_Dialog, _MarkInteractiveBool, _Speaker1, (CHARACTERGUID)_Speaker2, (CHARACTERGUID)_Speaker3, (CHARACTERGUID)_Speaker4, (CHARACTERGUID)_Speaker5, (CHARACTERGUID)_Speaker6, _OUTSuccess)
THEN
SetVarInteger(_GUID, "AMER_WRAP_OUT_INT", _OUTSuccess);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Start Party Dialog:
IF
CharacterCharacterEvent(_GUID, _Player1, "AMER_WRAP_StartPartyDialog")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Dialog)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DialogID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _NewDialogID)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID", _Player2)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID2", _Player3)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_GUID3", _Player4)
AND
DialogStartPartyDialog(_Dialog, _DialogID, _NewDialogID, _Player1, (CHARACTERGUID)_Player2, (CHARACTERGUID)_Player3, (CHARACTERGUID)_Player4,  _OUTSuccess)
THEN
SetVarInteger(_GUID, "AMER_WRAP_OUT_INT", _OUTSuccess);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Resume Dialog:
IF
StoryEvent(_GUID, "AMER_WRAP_ResumeDialog")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DialogID)
THEN
DialogResume(_DialogID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Character To Party:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddToParty")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _PartyMember)
THEN
CharacterAddToParty(_Target, (CHARACTERGUID)_PartyMember);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Enable Waypoint Usage:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_EnableWaypointUsage")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Flag)
THEN
CharacterEnableWaypointUsage(_Target, _Flag);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Level Up To:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_LevelUpTo")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Level)
THEN
CharacterLevelUpTo(_Target, _Level);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Recruit Character:
IF
CharacterCharacterEvent(_GUID, _Slave, "AMER_WRAP_RecruitCharacter")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Owner)
THEN
CharacterRecruitCharacter(_Slave, (CHARACTERGUID)_Owner);	//Unsure of the owner/slave ordering here.
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove From Player Character:
IF
CharacterCharacterEvent(_GUID, _Slave, "AMER_WRAP_RemoveFromPlayerCharacter")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Owner)
THEN
CharacterRemoveFromPlayerCharacter((CHARACTERGUID)_Owner, _Slave);	//Unsure of the owner/slave ordering here.
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Force Synch:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetForceSynch")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Flag)
THEN
CharacterSetForceSynch(_Target, _Flag);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_SetForceSynch")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Flag)
THEN
ItemSetForceSynch(_Target, _Flag);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unlink Ghost:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UnlinkGhost")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Ghost)
THEN
CharacterUnlinkGhost(_Target, (CHARACTERGUID)_Ghost);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Tension:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveTension")
THEN
CharacterRemoveTension(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Clear Dialog Flag:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ClearDialogFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DiagInstance)
THEN
ObjectClearDialogFlag(_Target, _FlagString, _DiagInstance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_ClearDialogFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DiagInstance)
THEN
ObjectClearDialogFlag(_Target, _FlagString, _DiagInstance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Dialog Flag:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetDialogFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DiagInstance)
THEN
ObjectSetDialogFlag(_Target, _FlagString, _DiagInstance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_SetDialogFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DiagInstance)
THEN
ObjectSetDialogFlag(_Target, _FlagString, _DiagInstance);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Share Flag:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ShareFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
THEN
ObjectShareFlag(_Target, _FlagString);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_ShareFlag")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FlagString)
THEN
ObjectShareFlag(_Target, _FlagString);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Camera Activate:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_CameraActivate")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Name)	//Probably Camera Name.
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Time)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _HideUI)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _Smooth)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _HideShroud)
THEN
CameraActivate(_Target, _Name, _Time, _HideUI, _Smooth, _HideShroud);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Start Camera Spline:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_StartCameraSpline")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_SPLINEGUID", _Camera)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _FadeTime)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UIVisible)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _Freeze)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _StartIndex)
THEN
StartCameraSpline((SPLINEGUID)_Camera, _Target, _FadeTime, _UIVisible, _Freeze, _StartIndex);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Stop Camera Spline:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_StopCameraSpline")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_SPLINEGUID", _Camera)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UIVisible)
THEN
StopCameraSpline((SPLINEGUID)_Camera, _Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Music Play For Peer:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_MusicPlayForPeer")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
MusicPlayForPeer(_Target, _Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Music Play For Peer With Instrument:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_MusicPlayForPeerWithInstrument")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Target2)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
MusicPlayForPeerWithInstrument(_Target, (CHARACTERGUID)_Target2, _Event);	//Unsure of the differentiation between targets here.
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Music Play General:
IF
StoryEvent(_GUID, "AMER_WRAP_MusicPlayGeneral")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
MusicPlayGeneral(_Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Music Play On Character:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_MusicPlayOnCharacter")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
MusicPlayOnCharacter(_Target, _Event);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Action Points:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddActionPoints")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
CharacterAddActionPoints(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Die Immediate:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_DieImmediate")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _GenerateTreasure)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _DeathType)
THEN
CharacterDieImmediate(_Target, _GenerateTreasure, _DeathType);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Jump To Turn:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_JumpToTurn")
THEN
JumpToTurn(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Reset Cooldowns:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ResetCooldowns")
THEN
CharacterResetCooldowns(_Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Resurrect Custom:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ResurrectCustom")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Animation)
THEN
CharacterResurrectCustom(_Target, _Animation);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Custom Name:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetCustomName")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Name)
THEN
CharacterSetCustomName(_Target, _Name);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Remove Summons:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RemoveSummons")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DieBool)
THEN
CharacterRemoveSummons(_Target, _DieBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Look At:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_LookAt")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _LookingChar)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _SnapBool)
THEN
CharacterLookAt((CHARACTERGUID)_LookingChar, _Target, _SnapBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_LookAt")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _LookingChar)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _SnapBool)
THEN
CharacterLookAt((CHARACTERGUID)_LookingChar, _Target, _SnapBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Attack:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Attack")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Attacker)
THEN
CharacterAttack((CHARACTERGUID)_Attacker, _Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_Attack")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Attacker)
THEN
CharacterAttack((CHARACTERGUID)_Attacker, _Target);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Unequip Item:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UnequipItem")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
THEN
CharacterUnequipItem(_Target, (ITEMGUID)_Item);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Generate Treasure:
IF
CharacterItemEvent(_GUID, _Item, "AMER_WRAP_GenerateTreasure")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Char)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Level)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Treasure)
THEN
GenerateTreasure(_Item, _Treasure, _Level, (CHARACTERGUID)_Char);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
StoryEvent(_GUID,"AMER_WRAP_GenerateTreasure")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Char)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Level)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Treasure)
THEN
GenerateTreasure((ITEMGUID)_Item, _Treasure, _Level, (CHARACTERGUID)_Char);
PROC_AMER_WRAP_Return((ITEMGUID)_GUID);
//END_REGION

//REGION Quest Receive Shared Update:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_QuestReceiveSharedUpdate")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _SourceChar)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Status)
THEN
QuestReceiveSharedUpdate((CHARACTERGUID)_SourceChar, _Target, _Quest, _Status); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Quest Update:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_QuestUpdate")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _Status)
THEN
QuestUpdate(_Target, _Quest, _Status); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Quest Add:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_QuestAdd")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
THEN
QuestAdd(_Target, _Quest); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Quest Close:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_QuestClose")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
THEN
QuestClose(_Target, _Quest); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Quest Archive:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_QuestArchive")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _DoArchive)
THEN
QuestArchive(_Target, _Quest, _DoArchive);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Secret:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddSecret")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
THEN
AddSecret(_Target, _Quest); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Quest Close All:
IF
StoryEvent(_GUID, "AMER_WRAP_QuestCloseAll")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Quest)
THEN
QuestCloseAll(_Quest); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Ignore Character Active Crimes
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_IgnoreCharacterActiveCrimes")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Player)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_STR", _Timer)
THEN
CharacterIgnoreCharacterActiveCrimes(_Target, (CHARACTERGUID)_Player, _Timer); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Crime Clear All:
IF
StoryEvent(_GUID, "AMER_WRAP_CrimeClearAll")
THEN
CrimeClearAll();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Shutdown Crime System:
IF
StoryEvent(_GUID, "AMER_WRAP_ShutdownCrimeSystem")
THEN
ShutdownCrimeSystem();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION User Rest:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UserRest")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Consume)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Radius)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _MinSafeDistance)
THEN
UserRest(_Target, _Consume, _Radius, _MinSafeDistance); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Identify All:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_IdentifyAll")
THEN
ContainerIdentifyAll(_Target); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
StoryEvent(_GUID, "AMER_WRAP_IdentifyAll")
AND
ObjectIsItem(_GUID, 1)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Target)
THEN
ContainerIdentifyAll((ITEMGUID)_Target); 
PROC_AMER_WRAP_Return((ITEMGUID)_GUID);
//END_REGION

//REGION Set Tag Price Modifier:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_SetTagPriceModifier")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Tag)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Modifier)
THEN
SetTagPriceModifier(_Target, _Tag, _Modifier); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Party Identify Price Modifier:
IF
CharacterCharacterEvent(_GUID, _Trader, "AMER_WRAP_SetPartyIdentifyModifier")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _PartyMember)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Modifier)
THEN
PartySetIdentifyPriceModifier(_Trader, (CHARACTERGUID)_PartyMember, _Modifier); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Party Repair Price Modifier:
IF
CharacterCharacterEvent(_GUID, _Trader, "AMER_WRAP_SetPartyRepairModifier")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _PartyMember)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Modifier)
THEN
PartySetRepairPriceModifier(_Trader, (CHARACTERGUID)_PartyMember, _Modifier); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Set Party Shop Price Modifier:
IF
CharacterCharacterEvent(_GUID, _Trader, "AMER_WRAP_SetPartyShopModifier")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _PartyMember)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Modifier)
THEN
PartySetShopPriceModifier(_Trader, (CHARACTERGUID)_PartyMember, _Modifier); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Transform Surface:
IF
CharacterCharacterEvent(_GUID, _Source, "AMER_WRAP_TransformSurface")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _TransType)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _TransLayer)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Radius)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Lifetime)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Owner)
THEN
TransformSurface(_Source, _TransType, _TransLayer, _Radius, _Lifetime, (CHARACTERGUID)_Owner); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Source, "AMER_WRAP_TransformSurface")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _TransType)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _TransLayer)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Radius)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Lifetime)
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Owner)
THEN
TransformSurface((ITEMGUID)_Source, _TransType, _TransLayer, _Radius, _Lifetime, (CHARACTERGUID)_Owner); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Transform Surface At Position:
IF
CharacterCharacterEvent(_GUID, _Owner, "AMER_WRAP_TransformSurfaceAtPosition")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _X)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Y)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT3", _Z)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _TransType)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _TransLayer)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT4", _Radius)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT5", _Lifetime)
THEN
TransformSurfaceAtPosition(_X, _Y, _Z, _TransType, _TransLayer, _Radius, _Lifetime, _Owner); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Create Puddle:
IF
CharacterCharacterEvent(_GUID, _Source, "AMER_WRAP_CreatePuddle")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _SurfaceType)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _CellAmountMin)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _CellAmountMax)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _GrowAmountMin)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT4", _GrowAmountMax)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _GrowTime)
THEN
CreatePuddle(_Source, _SurfaceType, _CellAmountMin, _CellAmountMax, _GrowAmountMin, _GrowAmountMax, _GrowTime); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Source, "AMER_WRAP_CreatePuddle")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _SurfaceType)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _CellAmountMin)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _CellAmountMax)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _GrowAmountMin)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT4", _GrowAmountMax)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _GrowTime)
THEN
CreatePuddle(_Source, _SurfaceType, _CellAmountMin, _CellAmountMax, _GrowAmountMin, _GrowAmountMax, _GrowTime); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Activate Persistent Level Template:
IF
StoryEvent(_GUID, "AMER_WRAP_ActivatePersistentLevelTemplate")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_TEMPLATEGUID", _Template)
THEN
ActivatePersistentLevelTemplate((LEVELTEMPLATEGUID)_Template);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Fire Osiris Events:
IF
StoryEvent(_GUID, "AMER_WRAP_FireOsirisEvents")
THEN
FireOsirisEvents();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Notify Character Creation Finished:
IF
StoryEvent(_GUID, "AMER_WRAP_NotifyCharacterCreationFinished")
THEN
NotifyCharacterCreationFinished();
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Request Processed:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_RequestProcessed")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _RequestID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _Bool)
THEN
RequestProcessed(_Target, _RequestID, _Bool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Open Craft UI:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_OpenCraftUI")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
THEN
OpenCraftUI(_Target, (ITEMGUID)_Item);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Close UI:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_CloseUI")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _UI)
THEN
CloseUI(_Target, _UI);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Fade To Black:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_FadeToBlack")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Seconds)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ToBlackBool)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _FadeID)
THEN
FadeToBlack(_Target, _Seconds, _ToBlackBool, _FadeID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Ready Check Start:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ReadyCheckStart")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _ID)
THEN
ReadyCheckStart(_Target, _ID);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Apply Damage:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ApplyDamage")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Damage)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Type)
THEN
ApplyDamage(_Target, _Damage, _Type);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Transform:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_Transform")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Root)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ReplaceScripts)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _ReplaceScale)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _ReplaceStats)
THEN
Transform(_Target, _Root, _ReplaceScripts, _ReplaceScale, _ReplaceStats);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_Transform")
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Root)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ReplaceScripts)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _ReplaceScale)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT3", _ReplaceStats)
THEN
Transform(_Target, _Root, _ReplaceScripts, _ReplaceScale, _ReplaceStats);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Item To Inventory:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_ItemToInventory")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
ItemToInventory((ITEMGUID)_Item, _Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_ItemToInventory")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _Item)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
ItemToInventory((ITEMGUID)_Item, _Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Move All Items To:
IF
CharacterItemEvent(_GUID, _FromMe, "AMER_WRAP_MoveAllItemsTo")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _ToMe)
AND
_ToMe != NULL_00000000-0000-0000-0000-000000000000
THEN
MoveAllItemsTo(_FromMe, (ITEMGUID)_ToMe);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _FromMe, "AMER_WRAP_MoveAllItemsTo")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _ToMe)
AND
_ToMe != NULL_00000000-0000-0000-0000-000000000000
THEN
MoveAllItemsTo(_FromMe, (CHARACTERGUID)_ToMe);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterCharacterEvent(_GUID, _FromMe, "AMER_WRAP_MoveAllItemsTo")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_ITEMGUID", _ToMe)
AND
_ToMe != NULL_00000000-0000-0000-0000-000000000000
THEN
MoveAllItemsTo(_FromMe, (ITEMGUID)_ToMe);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterCharacterEvent(_GUID, _FromMe, "AMER_WRAP_MoveAllItemsTo")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _ToMe)
AND
_ToMe != NULL_00000000-0000-0000-0000-000000000000
THEN
MoveAllItemsTo(_FromMe, (CHARACTERGUID)_ToMe);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION


//REGION Move To And Talk:
IF
CharacterCharacterEvent(_GUID, _Speaker, "AMER_WRAP_MoveToAndTalk")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Target)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _DialogID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _AutomatedBool)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR2", _MoveID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _RunningBool)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Timeout)
THEN
CharacterMoveToAndTalk(_Speaker, (CHARACTERGUID)_Target, _DialogID, _AutomatedBool, _MoveID, _RunningBool, _Timeout);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Force Use Skill:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_UseSkill")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Source)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _SkillID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ResetCDBool)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _IgnoreHasSkillBool)
THEN
CharacterUseSkill((CHARACTERGUID)_Source, _SkillID, _Target, _ResetCDBool, _IgnoreHasSkillBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);

IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_UseSkill")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Source)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _SkillID)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _ResetCDBool)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT2", _IgnoreHasSkillBool)
THEN
CharacterUseSkill((CHARACTERGUID)_Source, _SkillID, _Target, _ResetCDBool, _IgnoreHasSkillBool);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Item Set Original Owner:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_SetOriginalOwner")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_CHARGUID", _Owner)
THEN
ItemSetOriginalOwner(_Target, (CHARACTERGUID)_Owner);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Add Gold:
IF
CharacterCharacterEvent(_GUID, _Target, "AMER_WRAP_AddGold")
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _Amount)
THEN
UserAddGold(_Target, _Amount);
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Move Item To Position:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_MoveItemToPosition")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _X)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Y)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT3", _Z)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT4", _Speed)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT5", _Acceleration)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
ItemMoveToPosition(_Target, _X, _Y, _Z, _Speed, _Acceleration, _Event); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Move Item To Trigger:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_MoveItemToTrigger")
AND
GetVarObject(_GUID, "AMER_WRAP_PARAM_TRIGGUID", _Trigger)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Speed)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Acceleration)
AND
GetVarInteger(_GUID, "AMER_WRAP_PARAM_INT", _UseRotation)
AND
GetVarString(_GUID, "AMER_WRAP_PARAM_STR", _Event)
THEN
ItemMoveToTrigger(_Target, (TRIGGERGUID)_Trigger, _Speed, _Acceleration, _UseRotation, _Event); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION

//REGION Rotate To Angle:
IF
CharacterItemEvent(_GUID, _Target, "AMER_WRAP_RotateToAngle")
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT", _Angle)
AND
GetVarFloat(_GUID, "AMER_WRAP_PARAM_FLOAT2", _Speed)
THEN
ItemRotateToAngleY(_Target, _Angle, _Speed); 
PROC_AMER_WRAP_Return((CHARACTERGUID)_GUID);
//END_REGION





//==========================================================//
//                                                          //
//     S T O R Y   S C R I P T I N G    W R A P P E R S     //
//                                                          //
//     Written by Matteo "Ameranth" T. (2017)               //
//==========================================================//
EXITSECTION

ENDEXITSECTION
ParentTargetEdge "__Start"


Last edited by Ameranth; 20/09/17 09:28 PM.