Go Back   FileForums > Games > Game Coders
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 27-10-2011, 14:58
cocodrilo cocodrilo is offline
Registered User
 
Join Date: Jun 2011
Location: spain
Posts: 43
Thanks: 0
Thanked 1 Time in 1 Post
cocodrilo is on a distinguished road
Stronghold3 Trainer source code (by sicheats) Added god mode

This is the source code for the sicheats trainer, to run is necesary a dll included in the download rar. source of dll is not need, only loads a lua script and handle the onKeyDown function.

EDITED: added resources option.

Fixed: environment script execution fixed in the dll. link to dll http://www.megaupload.com/?d=UO8TMT05

Code:
--StrongHold3 trainer by cocodrilo.
--can you make your own options.
-- www.sicheats.com

function getLocalPlayer()
 local e = { GameLib.GetEstates() }
 for n,tmp in ipairs(e) do
   if tmp and tmp:GetPlayer():IsHumanControlled() then
     return tmp
   end
 end
 return nil
end

function addGold(gValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   miPlayer.m_gameState.iGold = miPlayer.m_gameState.iGold + gValue
 end
end

function addHonour(hValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   miPlayer.m_gameState.iHonour  = miPlayer.m_gameState.iHonour + hValue
 end
end

function addResources(rValue)
 local miPlayer = getLocalPlayer()
 if miPlayer~=nil then
   for i=1,31 do
     miPlayer.m_gameState.hResources[i] = Inc(miPlayer.m_gameState.hResources[i],rValue)
   end
 end
end

function Inc(a,b)
 return a+b
end

--Hooked Damage function. simply return, not call the original.
function miDamage()
 return
end

function setGodMode()
 local ent = GameLib.GetEntityUnderMouse()
 if ent~=nil then
  ent.Damage = miDamage
 end
end

function onKeyDown(key)
 if key==112 then  --F1: add gold
   addGold(5000)
 elseif key==113 then  --F2: add honour
   addHonour(1000)
 elseif key==114 then  --F3: no build costs
   Game.Options.Cheats.bNoBuildCosts = true
 elseif key==115 then  --F4: add resources
   addResources(1000)
 elseif key == 116 then -- F5: add god mode to selected unit
   setGodMode()
 end
end

Last edited by cocodrilo; 28-10-2011 at 17:25.
Reply With Quote
Sponsored Links
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Announcement and final word on the CheatHappens vs. h4x0r trainer war Joe Forster/STA Game Trainers 7 12-07-2010 08:31
trainer and source code... pikachu5501 Game Coders 2 14-05-2007 23:18



All times are GMT -7. The time now is 13:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com