Skip to content

Commit

Permalink
Replaced DealAttackDamage, added python spell_damage_weaponlike
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Oct 16, 2016
1 parent 12bb0a8 commit 378203e
Show file tree
Hide file tree
Showing 15 changed files with 442 additions and 7 deletions.
2 changes: 2 additions & 0 deletions TemplePlus/TemplePlus.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<ClCompile Include="ui\ui_dialog.cpp" />
<ClCompile Include="ui\ui_intgame_select.cpp" />
<ClCompile Include="ui\ui_legacysystems.cpp" />
<ClCompile Include="ui\ui_logbook.cpp" />
<ClCompile Include="ui\ui_party.cpp" />
<ClCompile Include="ui\ui_popup.cpp" />
<ClCompile Include="ui\ui_slider.cpp" />
Expand Down Expand Up @@ -319,6 +320,7 @@
<ClInclude Include="tutorial.h" />
<ClInclude Include="ui\ui_alert.h" />
<ClInclude Include="ui\ui_legacysystems.h" />
<ClInclude Include="ui\ui_logbook.h" />
<ClInclude Include="ui\ui_popup.h" />
<ClInclude Include="ui\ui_slider.h" />
<ClInclude Include="ui\ui_sticky.h" />
Expand Down
6 changes: 6 additions & 0 deletions TemplePlus/TemplePlus.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@
<ClCompile Include="ui\ui_intgame_select.cpp">
<Filter>ui</Filter>
</ClCompile>
<ClCompile Include="ui\ui_logbook.cpp">
<Filter>ui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="movies.h" />
Expand Down Expand Up @@ -849,6 +852,9 @@
<ClInclude Include="gamesystems\ui_intgame_renderer.h">
<Filter>ui</Filter>
</ClInclude>
<ClInclude Include="ui\ui_logbook.h">
<Filter>ui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Mods and Fixes">
Expand Down
5 changes: 5 additions & 0 deletions TemplePlus/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ void AiSystem::StopAttacking(objHndl npc) {
_StopAttacking(npc);
}

void AiSystem::ProvokeHostility(objHndl agitator, objHndl provokedNpc, int rangeType, int flags)
{
temple::GetRef<void(__cdecl)(objHndl, objHndl, int, int)>(0x1005E8D0)(agitator, provokedNpc, rangeType, flags);
}

objHndl AiSystem::GetCombatFocus(objHndl npc) {
auto obj = objSystem->GetObject(npc);
return obj->GetObjHndl(obj_f_npc_combat_focus);
Expand Down
1 change: 1 addition & 0 deletions TemplePlus/ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct AiSystem : temple::AddressTable
void ShitlistRemove(objHndl npc, objHndl target);
void FleeAdd(objHndl npc, objHndl target);
void StopAttacking(objHndl npc);
void ProvokeHostility(objHndl agitator, objHndl provokedNpc, int rangeType, int flags); // rangeType - 0 is for 5 tiles, 1 is for 10 tiles, 2 is for 20 tiles, and 3 is unlimited

objHndl GetCombatFocus(objHndl npc);
objHndl GetWhoHitMeLast(objHndl npc);
Expand Down
4 changes: 4 additions & 0 deletions TemplePlus/anim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ int AnimationGoals::PushAttemptAttack(objHndl attacker, objHndl defender) {
return addresses.PushAttemptAttack(attacker, defender);
}

int AnimationGoals::PushDodge(objHndl attacker, objHndl dodger){
return temple::GetRef<BOOL(__cdecl)(objHndl, objHndl)>(0x100158E0)(attacker, dodger);
}

int AnimationGoals::PushAnimate(objHndl obj, int anim) {
return addresses.PushAnimate(obj, anim);
}
Expand Down
3 changes: 2 additions & 1 deletion TemplePlus/anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum AnimGoalType : uint32_t {
ag_shoot_spell = 0x1D,
ag_hit_by_spell = 0x1E,
ag_hit_by_weapon = 0x1F,
ag_dodge = 0x20,
ag_dodge = 0x20, // this is where the enums start to be off compared to the debug string in the dll (they added ag_dodge and didn't update the list)
ag_dying,
ag_destroy_obj,
ag_use_skill_on,
Expand Down Expand Up @@ -153,6 +153,7 @@ class AnimationGoals {
int PushAttackAnim(objHndl actor, objHndl target, int unk1, int hitAnimIdx, int playCrit, int useSecondaryAnim);
int GetActionAnimId(objHndl objHndl);
int PushAttemptAttack(objHndl attacker, objHndl defender);
int PushDodge(objHndl attacker, objHndl dodger);
int PushAnimate(objHndl obj, int anim);
BOOL PushSpellInterrupt(const objHndl& caster, objHndl item, AnimGoalType animGoalType, int spellSchool);
};
Expand Down
4 changes: 2 additions & 2 deletions TemplePlus/d20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1761,8 +1761,8 @@ BOOL D20ActionCallbacks::ActionFrameStandardAttack(D20Actn* d20a){
histSys.CreateRollHistoryString(d20a->rollHistId1);
histSys.CreateRollHistoryString(d20a->rollHistId2);
histSys.CreateRollHistoryString(d20a->rollHistId0);
auto makeAttack = temple::GetRef<int(__cdecl)(objHndl, objHndl, int, D20CAF, D20ActionType)>(0x100B7950);
makeAttack(d20a->d20APerformer, d20a->d20ATarget, d20a->data1, static_cast<D20CAF>(d20a->d20Caf), d20a->d20ActType);
//auto makeAttack = temple::GetRef<int(__cdecl)(objHndl, objHndl, int, D20CAF, D20ActionType)>(0x100B7950);
damage.DealAttackDamage(d20a->d20APerformer, d20a->d20ATarget, d20a->data1, static_cast<D20CAF>(d20a->d20Caf), d20a->d20ActType);
return TRUE;
}

Expand Down
Loading

0 comments on commit 378203e

Please sign in to comment.