Add new weapons in ET isn’t so hard but it take the first time some huge effort to code it.
In summaryse to add a new weapon AK47, u can look of all occurence of WP_THOMPSON.
In dir weapons, create a file ak47.weap
In bg_public.h add WP_AK47 in the weapon_t enum just before the WP_GP40
In cg_weapons.c in function CG_RegisterWeapon add in the switch(weaponNum) case WP_AK47: filename = “ak47.weap”
In g_weapons.c in function FireWeapon add in the switch case WP_AK47: Bullet_Fire(…)
In bg_misc.c add WP_AK47 in weapBankMulitplayer in the 4th rows near WP_MP40
In bg_misc.c add WP_AK47 in reloadableWeapons variable
in bg_misc.c copy/paste from the variable ammoTableMP the line containing WP_THOMPSON infos and paste it just before the WP_GP40 (the line number must be equal to the value of WP_AK47)
in bg_misc.c add an entry into bg_itemlist definition copy/paste thompson and change name & value inside, name it “AK47”
in bg_misc.c in weapAlts[] add before WP_GP40 WP_NONE meaning that ur weapon doesn’t have an alternate weapon.
in function BG_WeaponInWolfMP add case WP_AK47:
in bg_move.c for each occurence of WP_THOMPSON add WP_AK47.
Do the same in cgame & game project.
Add WP_AK47 in the good classe of bg_classes.c
For the stats
create WS_AK47 in the enum extWeaponStats_s (bg_public.h) and add MOD_AK47 in meansOfDeath_t (bg_public.h)
In g_combat.c add into modNames variable at the end “MOD_AK47”
In g_combat.c add into function IsHeadShotWeapon || mod == MOD_AK47
In g_match.c add into aWeapMOD { MOD_AK47, WS_AK47 }
In g_stats.c in G_LooseKillSkillPoints near case MOD_THOMPSON add case MOD_AK47
In g_stats.c in G_AddKillSkillPoint do the same
in bg_misc.c in aWeaponInfo variable add at the end {qtrue, “AK47”, “AK47 Rifle” } // WS_AK47 must be in the same order of WS_AK47 value
Et Voila
I think i don’t forget anything
Regards
Now u must connect the 3rd person view animation to ur weapon. Because i think probably that u don’t have create new 3rd person views animation, u will use machinegun anims.
Modify the file animations/script/human_base.script, search each occurence of Thompson and add " AND AK47 " everywhere u find thompson.
Build icons iconw_ak47_1_select.tga in icons/