Raised This Month: $51 Target: $400
 12% 

[TF2] PLUGIN IDEA - Runescape Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nergal
Veteran Member
Join Date: Apr 2012
Old 11-04-2013 , 18:35   [TF2] PLUGIN IDEA - Runescape Mod
Reply With Quote #1

Since Valve has added spells and crap.

I was thinking why not make a MMORPG mod to improve medieval mode?

How Plugin should work------------------------------------------------------

Players will pick either a magic class, melee class, or ranged class (huntsman)

players who play the mod for the first time will be at level 1 (obviously).

players will level up based on each kill/point from team objectives they get

each damage players will take is randomized from based on their current coresponding level and base damage of weapon with a chance of "missing" (doing 0 damage).

NOT including melee, the higher a player's ranged or magic level, the higher chance they get of dealing damage and high damage.

With Melee, melee skills will be divided by 3 different levels: Attack; Strength; and Defense. Attack level will determine how accurate the next melee hit will be, while Strength level will determine damage, and Defense determining damage absorption.

Extended Details on Ranged class
Ranged Class players will have the choice of getting a non-explosive able distance projectile weapon such as Cleaver, Huntsman, Crossbow, Loose Cannon, and/or Rescue Ranger Repair Claw

Details on Magic Class
Magic Class player weapon choice will be any hold-able non-violent weapons such as Wrangler, Buff Banner, Mediguns, and/or Short Circuit. Each 'weapon' will have it's own spells and abilities to them.

Details on Melee Class
Already covered alot of basics with melee but basically, any melee weapon, some weapons with different abilities and stats to avoid redundancy.

Support Classes (optional, not really part of the main idea of the plugin, but i thought it up while writing this)
Apothecary - makes potions with different effects that can be applied to teammates or enemies via Jarate or Mad Milk
Constructor - makes ammo, and resources for spells/potions.

Balance of Combat
to make the game balanced, each combat class must counter the other.

Melee is countered by Magic
Magic is countered by Ranged
Ranged is countered by Melee
__________________
nergal is offline
Civiccod PRO
Member
Join Date: Nov 2012
Old 11-04-2013 , 20:57   Re: [TF2] PLUGIN IDEA - Runescape Mod
Reply With Quote #2

I thought runescape was dead, lol.
__________________
Available for private plugins at request.

Contact Me
Civiccod PRO is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 11-04-2013 , 21:11   Re: [TF2] PLUGIN IDEA - Runescape Mod
Reply With Quote #3

Quote:
Originally Posted by Civiccod PRO View Post
I thought runescape was dead, lol.
sadly it is.

This is based on the OLD Runescape, back when it was at it's zenith of popularity.

PHP Code:
/*
PLEASE NOTE THAT THIS PLUGIN HAS ALOT OF BORROWED CODE, IT'S BECAUSE I AM LAZY AND I DIDN'T FEEL LIKE CHECKING FOR FUNCTIONS
NERGAL

List of Plugins I borrowed code from
------------------------------------
Cosmetic Leveling Mod by noodleboy347
Saxton Hale plugin by Rainbolt Dash & Flamin' Sarge
Saxton Hale Menu by Dr.ShakShuka
*/

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <morecolors>
#include <tf2>
#include <tf2_stocks>
#include <tf2items>

#define PLUGIN_VERSION "1.0"

new playerLevel[MAXPLAYERS+1];
new 
playerExp[MAXPLAYERS+1];
new 
playerExpMax[MAXPLAYERS+1];
new 
Handle:levelHUD[MAXPLAYERS+1] = INVALID_HANDLE;
new 
Handle:hudLevel;
new 
Handle:hudEXP;
new 
Handle:hudPlus1;
new 
Handle:hudPlus2;
new 
Handle:hudLevelUp;
new 
Handle:rs_enable;
new 
Handle:cvar_level_default;
new 
Handle:cvar_level_max;
new 
Handle:cvar_exp_default;
new 
Handle:cvar_exp_onkill;
new 
Handle:cvar_exp_ondmg;

public 
Plugin:myinfo = {
    
name "Runescape Mod",
    
author "Assyrian/Nergal, noodleboy347, ",
    
description "Runescape mod for medieval mode",
    
version PLUGIN_VERSION,
    
url "http://steamcommunity.com/groups/acvsh"
};

public 
OnPluginStart()
{
    
CreateConVar("rs_version"PLUGIN_VERSION"Version of the plugin");
    
rs_enable CreateConVar("rs_enabled""1""Enables Runescape mod");
    
cvar_level_default CreateConVar("rs_level_default""1""Default level for players when they join");
    
cvar_level_max CreateConVar("rs_level_max""99""Maxmimum level players can reach and use to calculate damage");
    
cvar_exp_default CreateConVar("rs_exp_default""83""Default max experience for players when they join");
    
cvar_exp_onkill CreateConVar("rs_exp_onkill""116""Experience to gain on kill");
    
cvar_exp_ondmg CreateConVar("rs_exp_damage_mult""0.25""Experience multiplier for damage");
    
AutoExecConfig(true"RuneScapeMod");
    
    
// = CreateConVar("", "0", "", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    
hudLevel CreateHudSynchronizer();
    
hudEXP CreateHudSynchronizer();
    
hudPlus1 CreateHudSynchronizer();
    
hudPlus2 CreateHudSynchronizer();
    
hudLevelUp CreateHudSynchronizer();
    
HookEvent("player_spawn"event_player_spawn);
    
HookEvent("player_death"event_player_deathEventHookMode_Pre);
    
HookEvent("player_hurt"event_hurtEventHookMode_Pre);
    
//RegConsoleCmd("rs", RSMenu);
    
for (new client 0client <= MaxClientsclient++)
    {
        if (
IsValidClient(clientfalse))    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }
}
/*public OnConfigsExecuted()
{
}

new sgShieldProp = CreateEntityByName("prop_dynamic");
new Float:tempVec[3] = {0.0,...}; //vector to teleport it to
DispatchKeyValue(sgShieldProp, "model", "models/buildables/sentry_shield.mdl");
DispatchKeyValue(sgShieldProp, "skin", "0"); //0 is red, 1 is blu
DispatchSpawn(sgShieldProp);
TeleportEntity(sgShieldProp, tempVec, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(sgShieldProp, "TurnOn");
*/
public OnClientPutInServer(client)
{
    if (
GetConVarBool(rs_enable))
    {
        
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
        
playerLevel[client] = GetConVarInt(cvar_level_default); 
        
playerExp[client] = 0
        
playerExpMax[client] = GetConVarInt(cvar_exp_default);
        
levelHUD[client] = CreateTimer(5.0DrawHudclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    }
}
//SetMenuExitBackButton(menu, true);
public Action:DrawHud(Handle:timerany:client)
{
    if (
IsClientInGame(client))
    {
        if(
playerExp[client] >= playerExpMax[client] && playerLevel[client] < GetConVarInt(cvar_level_max))
        {
            
LevelUp(clientplayerLevel[client] + 1);
        }
        
SetHudTextParams(0.140.902.0100200255150);
        
ShowSyncHudText(clienthudLevel"Level: %i"playerLevel[client]);
        
SetHudTextParams(0.140.932.0255200100150);
        if(
playerLevel[client] >= GetConVarInt(cvar_level_max))
        {
            
ShowSyncHudText(clienthudEXP"MAX LEVEL REACHED"playerExp[client], playerExpMax[client]);
        }
        else
        {
            
ShowSyncHudText(clienthudEXP"EXP: %i/%i"playerExp[client], playerExpMax[client]);
        }
    }
    return 
Plugin_Continue;
}
/*public Action:Equipment(Handle:hTimer, any:clientid)
{
    new client = GetClientOfUserId(clientid);
    if (!IsValidClient(client) || !IsPlayerAlive(client))
        return Plugin_Continue;
    new weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary);
    new index = -1;
    if (weapon > MaxClients && IsValidEdict(weapon))
    {
        index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
        switch (index)
        {
        }
    }
    weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
    if (weapon > MaxClients && IsValidEdict(weapon))
    {
        index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
        switch (index)
        {
        }
    }
    weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee);
    if (weapon > MaxClients && IsValidEdict(weapon))
    {
        index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
        switch (index)
        {
        }
    }
    return Plugin_Continue;
}*/

public Action:event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (!
IsValidClient(clientfalse))
    {
        return 
Plugin_Continue;
    }
    new 
TFClassType:playerclass TF2_GetPlayerClass(client);
    switch (
playerclass)
    {
        case 
TFClass_ScoutTFClass_EngineerTFClass_PyroTFClass_SpyTFClass_SoldierTFClass_Heavy:
        {
            
TF2_SetPlayerClass(clientTFClass_Soldier_false);
        }
        case 
TFClass_DemoMan:    TF2_SetPlayerClass(clientTFClass_DemoMan_false);
        case 
TFClass_Medic:    TF2_SetPlayerClass(clientTFClass_Medic_false);
        case 
TFClass_Sniper:    TF2_SetPlayerClass(clientTFClass_Sniper_false);
    }
    
TF2_RemoveAllWeapons(client);
    
SetEntPropFloat(clientProp_Send"m_flMaxspeed"300.0);
    
SetEntPropFloat(clientProp_Send"m_iHealth"200.0);
    return 
Plugin_Continue;
}
public 
Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
damage GetEventInt(event"damageamount");
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if (!
IsValidClient(client) || !IsValidClient(attacker))
    {
        return 
Plugin_Continue;
    }
    new 
originalhp GetClientHealth(client);
    new 
Float:health RoundFloat(damage 0.133 5.0 originalhp);
    
SetEntPropFloat(attackerProp_Send"m_iHealth"health);
    if (
health 300)
    {
        
SetEntPropFloat(attackerProp_Send"m_iHealth"300.0);
    }
    if (
attacker && attacker <= MaxClients && attacker != client && GetConVarInt(cvar_exp_onkill) >= && playerLevel[attacker] < GetConVarInt(cvar_level_max) && IsClientInGame(attacker))
    {
        new 
expBoost1 GetConVarInt(cvar_exp_onkill);
        
playerExp[client] = playerExp[client] + expBoost1;
        
SetHudTextParams(0.280.931.02551001001501);
        
ShowSyncHudText(clienthudPlus2"+%i"expBoost1);
    }
    return 
Plugin_Changed;
}

public 
Action:event_hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    new 
damage GetEventInt(event"damageamount");
    if (!
IsValidClient(attacker) || !IsValidClient(client) || client == attacker)
    {
        return 
Plugin_Continue;
    }
    new 
percent GetConVarFloat(cvar_exp_ondmg);
    new 
Float:rawdamage = (damage Float:percent);
    new 
experience RoundToNearest(Float:rawdamage);
    if (!(
experience <= 0) && attacker && attacker <= MaxClients && IsClientInGame(attacker) && (attacker != client) && playerLevel[attacker] < GetConVarInt(cvar_level_max))
    {
        if (
experience >= playerExpMax[attacker])
        {
            
experience playerExpMax[attacker];
        }
        
playerExp[attacker] = playerExp[attacker] + experience;
        
SetHudTextParams(0.240.931.02551001001501);
        
ShowSyncHudText(clienthudPlus1"+%i"experience);
    }
    return 
Plugin_Continue;
}
public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])
{
    if (
attacker && victim != attacker)
    {
        if (
damagetype DMG_CRIT)
        {
            return 
Plugin_Continue;
        }
        
decl Float:vec1[3];
        
decl Float:vec2[3];
        
GetEntPropVector(attackerProp_Send"m_vecOrigin"vec1); //Spot of attacker
        
GetEntPropVector(victimProp_Send"m_vecOrigin"vec2); //Spot of victim
        
new Float:dist GetVectorDistance(vec1vec2false); //Calculates the distance between target and attacker

        
new String:classname[64];
        if (
IsValidEdict(weapon)) GetEdictClassname(weaponclassnamesizeof(classname));
        
/*melee and range damage formulas
        damage = 5 + C + C*D/64
        damage = 5 + C * (D + 64) / 64
        damage = 5 + C * (1 + D/64)
        C = "combat style"
        D = "damage modifier"
        */
}
stock SpawnWeapon(clientString:name[], indexlevelqualString:att[])
{
    new 
Handle:hWeapon TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
    if (
hWeapon == INVALID_HANDLE)
        return -
1;
    
TF2Items_SetClassname(hWeaponname);
    
TF2Items_SetItemIndex(hWeaponindex);
    
TF2Items_SetLevel(hWeaponlevel);
    
TF2Items_SetQuality(hWeaponqual);
    new 
String:atts[32][32];
    new 
count ExplodeString(att" ; "atts3232);
    if (
count 0)
    {
        
TF2Items_SetNumAttributes(hWeaponcount/2);
        new 
i2 0;
        for (new 
0count+= 2)
        {
            
TF2Items_SetAttribute(hWeaponi2StringToInt(atts[i]), StringToFloat(atts[i+1]));
            
i2++;
        }
    }
    else
        
TF2Items_SetNumAttributes(hWeapon0);

    new 
entity TF2Items_GiveNamedItem(clienthWeapon);
    
CloseHandle(hWeapon);
    
EquipPlayerWeapon(cliententity);
    return 
entity;
}
stock bool:IsValidClient(clientbool:bReplay true)
{
    if (
client <= || client MaxClients)
        return 
false;
    if (!
IsClientInGame(client))
        return 
false;
    if (
bReplay && (IsClientSourceTV(client) || IsClientReplay(client)))
        return 
false;
    return 
true;
}
stock LevelUp(clientlevel)
{
    
playerLevel(client) = level;
    
playerExp(client) -= playerExpMax(client);
    
SetHudTextParams(0.220.905.01002551001502);
    
ShowSyncHudText(clienthudLevelUp"LEVEL UP!");
    
playerExpMax(client) = RoundFloat((playerExpMax(client)*1.10) + playerExpMax(client));
    if (
level == GetConVarInt(cvar_level_max))
    {
        
playerExpMax[client] = 0;
    }
    
CPrintToChatAllEx(client"{teamcolor}%N{default} has grown to: {green}Level %i"clientplayerLevel[client]);

__________________

Last edited by nergal; 11-15-2013 at 20:55.
nergal is offline
Reply



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


All times are GMT -4. The time now is 16:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode