besoin aide svp

Section Française de l'emulateur Dawn of light.

Moderators: Support Team, Other Language Team

besoin aide svp

Postby snoopydo » Wed Oct 02, 2013 8:21 am

bonjour dol ,

je suis entrain de mettre a jours des fichier et je rencontre un probleme avec une ligne de code qui es tcelle ci.
Code: Select all
public Style GetStyle(string stylename) { if (stylename != null) { DataObject[] specs = GameServer.Database.SelectAllObjects(typeof(DBSpecialization)); if (specs != null) { foreach (DBSpecialization spec in specs) { if (spec.Styles != null) { foreach (DBStyle style in spec.Styles) { if (style.Name == stylename) { Style st = new Style(style); return st; } } } } } } return null; }
la ligne a mettre a jour est celle ci.
DataObject[] specs = GameServer.Database.SelectAllObjects(typeof(DBSpecialization));

si quelqu'un peut m'aider , ca serait vraiment sympas !
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm

Re: besoin aide svp

Postby Leodagan » Wed Oct 02, 2013 8:41 am

quelquechose du genre :
Code: Select all
IList<DBSpecialization> specs = GameServer.Database.SelectAllObjects<DBSpecialization>();
Devrais faire l'affaire !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: besoin aide svp

Postby snoopydo » Wed Oct 02, 2013 8:56 am

un gros merci leodagan :)
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm

Re: besoin aide svp

Postby snoopydo » Wed Oct 02, 2013 12:49 pm

rebonjour dol :)

me reste une erreur et suis tranquille un petit moment.
Code: Select all
generic2.CopyFrom(tgeneric2);
je ne trouve pas par quel mots mettre a jour copyfrom.
un coup de main m'aiderait beaucoup :)
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm

Re: besoin aide svp

Postby Leodagan » Wed Oct 02, 2013 5:32 pm

Manque de contexte...

Il faut au moins les types des objets auxquels tu veux appliquer des méthode sinon c'est incompréhensible !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: besoin aide svp

Postby snoopydo » Wed Oct 02, 2013 6:36 pm

dsl :) voici

Code: Select all
case "1" : foreach (GamePlayer player2 in player.GetPlayersInRadius(1000)) { if (WorldMgr.GetDistance(player, player2) >= 1 && WorldMgr.GetDistance(player, player2) <= 1000) { player2.Out.SendMessage(player.Name + "a obtenu ca recompense !!! revenez vite ...", eChatType.CT_System, eChatLoc.CL_SystemWindow); player2.GainBountyPoints(1000); player2.MoveTo(51, 535070, 548720, 4800, 1676); } } player.AddMoney(Money.GetMoney(0, 0, 0, 2, 0 + Util.Random(60)), "Vous recevez 2 pièces d'argent du Gaia radin!"); player.GainExperience(GameLiving.eXPSource.Quest, (50000000)); player.GainBountyPoints(2000); player.GainRealmPoints(3000); InventoryItem generic1 = new InventoryItem(); ItemTemplate tgeneric1 = (ItemTemplate)GameServer.Database.FindObjectByKey<ItemTemplate>( "1"); generic1.CopyFrom(tgeneric1); player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic1); player.Out.SendMessage("Très bon choix ma hache !!! ... aller disparait de ma vue maintenant...", eChatType.CT_System, eChatLoc.CL_SystemWindow); player.MoveTo(51, 535070, 548720, 4800, 1676); break;
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm

Re: besoin aide svp

Postby Leodagan » Wed Oct 02, 2013 9:57 pm

Pourquoi tu fait une copy de l'item ?

Il ya des methode pour ajouter directement un itemtemplate a l'inventaire d'un joueur.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: besoin aide svp

Postby snoopydo » Thu Oct 03, 2013 9:22 am

salut :)

bah en faite c'est des vieux scripts que j'ai eu ici que je m'amuse a mettre a jour.
et la je bloque carrément car je ne vois pas par quoi remplacer. le compilateur ne m'aide pas en faite.
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm

Re: besoin aide svp

Postby Leodagan » Thu Oct 03, 2013 10:55 am

utilise player.Inventory avec la methode suivante :
Code: Select all
public override bool AddTemplate(InventoryItem template, int count, eInventorySlot minSlot, eInventorySlot maxSlot)
exemple
Code: Select all
player.Inventory.AddTemplate(GameInventoryItem.Create<ItemTemplate>(template), amount, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack);
tu peux tester le booleen en retour pour t'assurer que le joueur a obtenu l'item
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: besoin aide svp

Postby snoopydo » Thu Oct 03, 2013 11:12 am

encore une fois merci :)
snoopydo
DOL Freak
 
Posts: 578
Joined: Mon Jan 02, 2006 12:48 pm


Return to “%s” Français

Who is online

Users browsing this forum: No registered users and 1 guest