Member
Join Date: Oct 2011
Location: Serbia, Nish
|
10-09-2011
, 06:35
League of Legends [CS 1.6] -> Need Help
|
#1
|
I started writing League of Legends (lol) mod for Counter-Strike 1.6 (CS 1.6)
Down there is the list what the mod should be, but its not like that! My mod is way to far from the notes i wrote down there, and that's why i need your help, because i can't make everything working, as i said in notes ^.^
And this is all about this mod:
- Players are beginning in spec, and they can choose their hero, level him up, buy items for helping in fights, use special ability... (hero's level and experience is restarted every round)
- Spec is Lobby, where players can see their Influence Points, Their level (which is earned from rounds), buy new heroes from Influence Points... Players can leave the round and go to lobby, but they will lose 150 points (by default) for leaving the team!
- No round end, auto re spawn... But when a player dies, he need to wait certain amount of time to get his re spawn
- Goal of the game is to destroy all the enemy turrets, and that's the end of map.. Turrets deal great damage, so that's why team work is here important! Map is changed, all players are in lobby, choosing their heroes, and then spawned, and start fighting...
- All the heroes will have knifes, some of them will have ranged weapons, but wont deal great damage (like Tristana will have AWP, but will deal about 50 Damage...)
- After leveling a hero, you can upgrade his special ability for better results in fights...
- Minions are spawned every 30 seconds for helping Summoners (players) defeat the enemies or Turrets...
- Killing Enemies or Minions or Destroying turrets is awarded for EXTRA gold, which you use in shop, to buy some extra items that will help in fights...
- Players are auto-receiving gold and energy every second, so if they lose energy in fight they will get regeneration...
That's it! I'm glad u rode it
Here is the Current Source code:
PHP Code:
#include <amxmodx> #include <cstrike> #include <colorchat> #include <fun> #include <hamsandwich>
#define TASK_GIVEGOLD 523 #define TASK_SHOWINFO 672 #define TASK_GIVEENERGY 745
enum { None, Master_Yi, Tristana, Tyndramere, Garen }
new const hero_name[][] = { "None", "Master Yi", "Tristana", "Tyndramere", "Garen" }
new const hero_energy[] = { 100, 520, 480, 540, 540 }
/*=====================*/ new hero_level[33] new hero_experience[33] new hero_gold[33] new hero_max_energy[33] /*=====================*/
/*=============================*/ new player_level[33] new player_influence_points[33] new player_hero[33] /*=============================*/
new SyncHud new SyncHud2
new bool:has_rocket_boots[33]
/*==============================================================*/ public plugin_init() { register_plugin("League of Legends", "1.0", "MiloS -.-") register_clcmd("say /shop", "Shop") register_clcmd("say /test", "TestCommand") register_cvar("hero_killxp", "20") register_cvar("hero_killgold", "250") register_cvar("hero_energyup", "20") register_event("CurWeapon", "CurWeapon", "be", "1=1") RegisterHam(Ham_Killed, "player", "Death", 1) RegisterHam(Ham_Spawn, "player", "Spawn", 1) SyncHud = CreateHudSyncObj() SyncHud2 = CreateHudSyncObj() } /*==============================================================*/
/*================================*/ public TestCommand(id) { hero_gold[id] += 500 hero_experience[id] += 500 Hero_CheckLevel(id) } /*================================*/
/*===================================================*/ public client_putinserver(id) { set_task(0.1, "ShowInfo", id + TASK_SHOWINFO) set_task(1.0, "GiveGold", id + TASK_GIVEGOLD) set_task(1.0, "GiveEnergy", id + TASK_GIVEENERGY) } /*===================================================*/
/*======================================================================*/ public Death(victim, attacker) { if(attacker != victim) { hero_experience[attacker] += get_cvar_num("hero_killxp") hero_gold[attacker] += get_cvar_num("hero_killgold") Hero_CheckLevel(attacker) } } /*======================================================================*/
/*=======================================================*/ public Spawn(id) { if(!is_user_alive(id)) { return PLUGIN_HANDLED } if(!player_hero[id]) { ChooseHero(id) } hero_max_energy[id] = hero_energy[player_hero[id]] set_user_health(id, hero_energy[player_hero[id]]) return PLUGIN_CONTINUE } /*=======================================================*/
/*================================================================*/ public CurWeapon(id) { if(has_rocket_boots[id]) { set_user_maxspeed(id, get_user_maxspeed(id) + 10.0) } } /*================================================================*/
/*=======================================================================================*/ public Hero_CheckLevel(id) { if(hero_level[id] < 18) { while(hero_experience[id] >= (hero_level[id] * 5 * (hero_level[id] / 2))) { hero_level[id] ++ hero_max_energy[id] += get_cvar_num("hero_energyup") set_hudmessage(0, 255, 0, -1.0, 0.20, 0, 6.0, 3.0) ShowSyncHudMsg(id, SyncHud2, "Level Up!") } } } /*=======================================================================================*/
/*======================================================================*/ public ChooseHero(id) { new menu = menu_create("Choose your Hero!", "ChooseHero_Handle") for(new i = 1; i < sizeof hero_name; i ++) { menu_additem(menu, hero_name[i]) } menu_display(id, menu) } public ChooseHero_Handle(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } item ++ if(player_hero[id] != item) { player_hero[id] = item } Spawn(id) return PLUGIN_CONTINUE } /*======================================================================*/
/*=================================================================================*/ public Shop(id) { new menu = menu_create("Shop", "Shop_Handle") menu_additem(menu, "\yRocket Boots \r[Adds 10% Speed] \yCost: \r[850g]") menu_additem(menu, "\yTitanium Sword \r[Adds 50 Damage] \yCost: \r[1050g]") menu_display(id, menu) } public Shop_Handle(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) } menu_display(id, menu) switch(item) { case 0: { if(hero_gold[id] < 850) { ColorChat(id, NORMAL, "^4[League of Legends] ^3You don't have enough gold to buy this") return PLUGIN_HANDLED } else { set_user_maxspeed(id, get_user_maxspeed(id) + 10.0) has_rocket_boots[id] = true hero_gold[id] -= 850 ColorChat(id, NORMAL, "^4[League of Legends] ^3You bought Rocket Boots, Good Luck") } } case 1: { if(hero_gold[id] < 1050) { ColorChat(id, NORMAL, "^4[League of Legends] ^3You don't have enough gold to buy this") return PLUGIN_HANDLED } else { ColorChat(id, NORMAL, "^4[League of Legends] ^3You bought Titanium Sword, Good Luck") } } } return PLUGIN_CONTINUE } /*=================================================================================*/
/*=======================================================*/ public ShowInfo(id) { id -= TASK_SHOWINFO set_task(0.1, "ShowInfo", id + TASK_SHOWINFO) set_hudmessage(0, 255, 0, -1.0, 0.80, 0, 6.0, 0.1) ShowSyncHudMsg(id, SyncHud, "[Hero: %s][Gold: %d][Energy: %d]^n[Experience: %i / %i][Level: %i]", hero_name[player_hero[id]], hero_gold[id], get_user_health(id), hero_experience[id], hero_level[id] * 5 * (hero_level[id] / 2), hero_level[id]) } /*=======================================================*/
/*===================================================*/ public GiveGold(id) { id -= TASK_GIVEGOLD set_task(1.0, "GiveGold", id + TASK_GIVEGOLD) hero_gold[id] += 1 } /*===================================================*/
/*==============================================================*/ public GiveEnergy(id) { id -= TASK_GIVEENERGY set_task(1.0, "GiveEnergy", id + TASK_GIVEENERGY) new new_health = (get_user_health(id) + 1 < hero_max_energy[id]) ? get_user_health(id) + 1:hero_max_energy[id] set_user_health(id, new_health) } /*==============================================================*/
/*=====================================*/ public client_disconnect(id) { remove_task(id + TASK_SHOWINFO) remove_task(id + TASK_GIVEGOLD) remove_task(id + TASK_GIVEENERGY) } /*=====================================*/
And here are all the problems:
- I don't know how to detect map end, or all turrets destroyed, so this is now a shitty hero mod
- What i need to put in client put in server so players will be asked first to choose hero, then team (blues or purples...)
- I have something for turrets, but i don't have the model :\ i will give you the code of Turret i have down there
- Minions... Is it even possible to make minions that will go around the map, and try to kill enemies/turrets
Source code of Turrets:
PHP Code:
public CreateSentryGun(id) { if(!(entity_get_int(id, EV_INT_flags) & FL_ONGROUND)) { return } new num new players[32] new Float:Origin[3] get_players(players, num, "gh") entity_get_vector(id, EV_VEC_origin, Origin) Origin[2] += 45.0 new ent = create_entity("info_target") entity_set_string(ent, EV_SZ_classname, "turret") entity_set_model(ent, "models/turret.mdl") entity_set_float(ent, EV_FL_health, 2555) entity_set_float(ent, EV_FL_takedamage, DAMAGE_YES) entity_set_size(ent, Float: { -16.0, -16.0, 0.0 }, Float: { 16.0, 16.0, 48.0 }) entity_set_origin(ent, Origin) entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX) entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS) entity_set_int(ent, EV_INT_iuser2, id) entity_set_vector(ent, EV_VEC_angles, Float: { 0.0, 0.0, 0.0 }) entity_set_byte(ent, EV_BYTE_controller2, 127) entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0) }
public SentryThink(ent) { if(!is_valid_ent(ent)) { return PLUGIN_CONTINUE } new Float:SentryOrigin[3] new Float:closestOrigin[3] entity_get_vector(ent, EV_VEC_origin, SentryOrigin) new id = entity_get_int(ent, EV_INT_iuser2) new target = entity_get_edict(ent, EV_ENT_euser1) new firemods = entity_get_int(ent, EV_INT_iuser1) if(firemods) { if(ExecuteHam(Ham_FVisible, target, ent) && is_user_alive(target)) { new Float:TargetOrigin[3] entity_get_vector(target, EV_VEC_origin, TargetOrigin) sentry_turntotarget(ent, SentryOrigin, TargetOrigin) new Float:hitRatio = random_float(0.0, 1.0) - 0.2 if(hitRatio <= 0.0) { UTIL_Kill(id, target, random_float(5.0, 35.0), DMG_BULLET, 1) message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_TRACER) write_coord(floatround(SentryOrigin[0])) write_coord(floatround(SentryOrigin[1])) write_coord(floatround(SentryOrigin[2])) write_coord(floatround(TargetOrigin[0])) write_coord(floatround(TargetOrigin[1])) write_coord(floatround(TargetOrigin[2])) message_end() } entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1) return PLUGIN_CONTINUE } else { firemods = 0 entity_set_int(ent, EV_INT_iuser1, 0) entity_set_edict(ent, EV_ENT_euser1, 0) } } new closestTarget = getClosestPlayer(ent) if(closestTarget) { entity_get_vector(closestTarget, EV_VEC_origin, closestOrigin) turret_turntotarget(ent, SentryOrigin, closestOrigin) entity_set_int(ent, EV_INT_iuser1, 1) entity_set_edict(ent, EV_ENT_euser1, closestTarget) entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0) return PLUGIN_CONTINUE } if(!firemods) { new controler1 = entity_get_byte(ent, EV_BYTE_controller1) + 1 if(controler1 > 255) { controler1 = 0 } entity_set_byte(ent, EV_BYTE_controller1, controler1) new controler2 = entity_get_byte(ent, EV_BYTE_controller2) if(controler2 > 127 || controler2 < 127) { entity_set_byte(ent, EV_BYTE_controller2, 127) } entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.05) } return PLUGIN_CONTINUE }
public turret_turntotarget(ent, Float:sentryOrigin[3], Float:closestOrigin[3]) { new newTrip new Float:newAngle = (floatatan(((closestOrigin[1] - sentryOrigin[1]) / (closestOrigin[0] - sentryOrigin[0])), radian) * 57.2957795) if(closestOrigin[0] < sentryOrigin[0]) { newAngle += 180.0 } if(newAngle < 0.0) { newAngle += 360.0 } sentryOrigin[2] += 35.0 if(closestOrigin[2] > sentryOrigin[2]) { newTrip = 0 } if(closestOrigin[2] < sentryOrigin[2]) { newTrip = 255 } if(closestOrigin[2] == sentryOrigin[2]) { newTrip = 127 } entity_set_byte(ent, EV_BYTE_controller1, floatround(newAngle * 0.70833)) entity_set_byte(ent, EV_BYTE_controller2, newTrip) entity_set_byte(ent, EV_BYTE_controller3, entity_get_byte(ent, EV_BYTE_controller3) + 20 > 255? 0: entity_get_byte(ent, EV_BYTE_controller3) + 20) }
__________________
|
|