ID:157124
 
Alright I don't know how to look for this through Search

Ok my problem is that I created a system that creates a mob when "X" quest is chosen. But I was looking to make that mob be just as strong as the player but I dont seem to find a way to do it T^T

Can someone post a proc or something that could work?

Here is piece of the Quest Verb:
    verb/Quest()
set name="Start Quest"
set category="Quests"
set src in oview(1)
if(canQuest)
switch(input("What kind of quest shall you start?") in list("Generation Gems","Breakthrough Gems","Unique Gems","Special Items","Cancel"))
if("Cancel")
return
if("Breakthrough Gems")
canQuest=0
usr.NonPK=0
usr.inWorld=1
usr.cansave=0
var/list/Quests=list()
if(!usr.AlphaGem)
Quests.Add("Alpha Gem")
if(!usr.ApocalypseGem)
Quests.Add("Apocalypse Gem")
if(!usr.ArmageddonGem)
Quests.Add("Armageddon Gem")
if(!usr.GluttonyGem)
Quests.Add("Gluttony Gem")
if(!usr.ReverseGGem)
Quests.Add("Reverse Gluttony Gem")
if(!usr.ChaoticGem)
Quests.Add("Chaotic Gem")
if(!usr.WrathGem)
Quests.Add("Wrath Gem")
if(!usr.LeopardGem)
Quests.Add("Leopard Gem")
if(!usr.WyvernGem)
Quests.Add("Wyvern Gem")
if(!usr.ExabyteGem)
Quests.Add("Exabyte Gem")
if(!usr.SacredGem)
Quests.Add("Sacred Gem")
if(!usr.CrimsonGem)
Quests.Add("Crimson Gem")
if(!usr.NightmareGem)
Quests.Add("Nightmare Gem")
if(!usr.ViralGem)
Quests.Add("Viral Gem")
if(!usr.FighterGem)
Quests.Add("Fighter Gem")
if(!usr.PaladinGem)
Quests.Add("Paladin Gem")
if(!usr.KentaurosGem)
Quests.Add("Kentauros Gem")
if(!usr.EnvyGem)
Quests.Add("Envy Gem")
if(!usr.LustGem)
Quests.Add("Lust Gem")
if(!usr.RhodoniteGem)
Quests.Add("Rhodonite Gem")
if(!usr.PrideGem)
Quests.Add("Pride Gem")
if(!usr.MiraclesGem)
Quests.Add("Miracles Gem")
if(!usr.BelialGem)
Quests.Add("Belial Gem")
if(!usr.WarGem)
Quests.Add("War Gem")
if(!usr.SpeedGem)
Quests.Add("Speed Gem")
if(!usr.MillenniaGem)
Quests.Add("Millennia Gem")
if(!usr.LunarMillenniaGem)
Quests.Add("Lunar Millennia Gem")
if(!usr.OceanicGem)
Quests.Add("Oceanic Gem")
if(!usr.OmegaGem)
Quests.Add("Omega Gem")
if(!usr.RavenGem)
Quests.Add("Raven Gem")
if(!usr.RosaGem)
Quests.Add("Rosa Gem")
if(!usr.ShiningGem)
Quests.Add("Shining Gem")
if(!usr.OpaqueGem)
Quests.Add("Opaque Gem")
if(!usr.UlforceGem)
Quests.Add("Ulforce Gem")
if(!usr.FutureGem)
Quests.Add("Future Gem")
if(!usr.VictoryGem)
Quests.Add("Victory Gem")
if(!usr.ZeedMillenniaGem)
Quests.Add("Zeed Millennia Gem")
Quests.Add("Cancel")
var/G=input("Which Gem do you wish to try to earn?") in Quests
if(G=="Cancel")
canQuest=1
usr.cansave=1
usr.NonPK=1
usr.inWorld=0
return
random=rand(1,2)
if(random==1)
usr.loc=locate(1,238,20)
if(random==2)
usr.loc=locate(30,238,20)
usr.Quest=G
if(G=="Alpha Gem")
var/mob/QuestNPC/A = /mob/QuestNPC/QuestAlphamon
new A(locate(15,265,20))


here are the mob and the proc that should make the mob and player equals (Actually the mob is to be stronger)
mob
var
tmp/QuestNPC=0
tmp/inQuest=0

proc
QuestBalance()
for(var/mob/M in world)
if(M.QuestNPC)
M.health=round(usr.Mhealth*1.25)
M.magic=round(usr.Mmagic*1.25)
M.strength=round(usr.strength*1.25)
M.defense=round(usr.defense*1.25)
M.speed=round(usr.speed*1.25)
M.spirit=round(usr.spirit*1.25)
M.Level=usr.Level


QuestNPC
QuestNPC=1
rank="Mega"
QuestAlphamon
icon='Digimons/Mega/Alphamon.dmi'
icon_state="1"
Digimon="Alphamon"
name="{Quest}Alphamon"
health=1
magic=1
strength=1
defense=1
spirit=1
speed=1
Level=1


Everything seems to work fine except the QuestBalance proc... The mob is created and put in the right place... but his stats dont change no matter what I do
Why are you putting usr in a proc? It's not a verb. Pass whoever's the person doing the quest into the proc as an argument. That should fix the problem, I think.
In response to 167981728
I did it and it hasnt worked...
In response to Goukaryuu
    proc
QuestBalance(var/mob/QuestTaker)
for(var/mob/M in world)
if(M.QuestNPC)
M.health=round(QuestTaker.Mhealth*1.25)
M.magic=round(QuestTaker.Mmagic*1.25)
M.strength=round(QuestTaker.strength*1.25)
M.defense=round(QuestTaker.defense*1.25)
M.speed=round(QuestTaker.speed*1.25)
M.spirit=round(QuestTaker.spirit*1.25)
M.Level=QuestTaker.Level


This is what I'm talking about. Pass the Quest Taker into this proc when calling it and it should work, I guarantee it.
In response to 167981728
but the quest taker its not the one that has to get balanced... it is the new mob Im creating
In response to Goukaryuu
I was simply changing your references of usr to whatever mob you implied usr to be. I'm not trying to mess with anything else, as the reason nothing was happening before (which is what you asked about) is because you tried to use usr in a proc. There is no usr in a proc.
In response to 167981728
yeah I know xD

I tried this now
                    if(G=="Alpha Gem")
var/mob/EnemyNPC/QuestAlphamon/A = new /mob/EnemyNPC/QuestAlphamon
A.Opponent=usr
A.strength=usr.strength
A.speed=usr.speed
A.spirit=usr.strength
A.defense=usr.strength
A.health=usr.strength
A.magic=usr.strength
A.loc=locate(15,265,20)


thats inside the QuestTaker verb

But now the mob Im creating isnt appearing where Im telling him to through the locate proc... but it IS being created somewhere and when I summon it and check his vars they werent modified by the code above o.O This is driving me crazy

Sorry if I sounded rude up there... It wasnt my intention I've been working on this 6 hours now and nothing works o.O so Im sorry
In response to Goukaryuu
That's fine. Are you sure you're using the right dimensions? I find it odd that you have 20 huge maps. Z/the third location value is the map number.
In response to 167981728
yeah o.O and not only that but either way when I summon it and check the new mobs stats they werent modified o.O they are still the default ones0
There is no need to loop through every mob in the world. When you create the mob, you can get a reference to it easily (var/mob/M = new /mob()). Then you can just do whatever it is you want to do to M right there.